Firestore connector

Read, write, and query Cloud Firestore documents and check security rules from AgentRuntime workflows.

On this page

The firestore connector lets workflows work with a Google Cloud Firestore database: fetch documents, query collections, add and update documents, list collections, and read or validate security rules.

Prerequisites

  • A Google Cloud project with a Firestore database.
  • A Google Cloud service account that can read (and, for write tools, write) that database.
  • The project_contributor role or higher in your workspace, which lets you manage connections and MCP instances. See Roles and permissions.

Connect in AgentRuntime

  1. Prepare Google Cloud access

    In the Google Cloud console, note your project ID and the Firestore database ID (it is (default) unless you created a named database). Create a service account with the Firestore permissions you need.

  2. Add the connector to your workspace

    Click MCP in the sidebar, then Add connectors. Find Firestore in the App catalog, select it, and click Add to workspace. The instance now appears on the MCP connectors page. See MCP instances.

  3. Add your credentials to a profile

    Open the new instance to reach Instance config. Under Profiles for this connector, click New profile, enter a Display name, and on the Type secrets on this screen tab fill in firestore_project_id and, if you use a named database, firestore_database. See the warning below about firestore_credentials_json. Set Status to Active — can be used in workflows and click Save. Then click Use this profile for workflows.

  4. Test it

    In Workflow Studio, add the firestore_list_collections tool from your Firestore instance (use Browse platform MCP if it is not listed), fill in its arguments, and run the workflow. A successful step means the connection works. With no parent_path it lists the top-level collections.

Warning

firestore_credentials_json takes the path to a service account key file that the connector can read. It does not accept the key's JSON contents. If you leave it empty, the connector uses the default Google credentials available to the connector. Check with AgentRuntime support before relying on this connector for your own Firebase project.

Note

To reuse the same credentials in more than one profile, save them first under Connections → New custom connection, using the exact key names from Configuration, then choose Use a saved connection on the profile instead.

What you can build

  • Event log. An inbound webhook starts a workflow that stores each event with firestore_add_documents.
  • Profile sync. After a sign-up, firestore_update_document merges profile fields into an existing document, limited by update_mask.
  • Ops dashboard. firestore_query_collection finds open items, and an LLM step turns them into a daily summary.
  • Rules check. firestore_validate_rules checks a proposed rules file, and the workflow stops if valid is false.

Tools

The Required arguments column lists the fields the tool's input schema marks as required. Some of them are optional in practice; if you have nothing to set, pass an empty value such as "", [], {}, or false.

Tools marked Delete remove documents permanently.

ToolAccessWhat it doesRequired arguments
firestore_add_documentsWriteAdd a document with an auto-generated ID to a Firestore collection.collection_path, document_data, return_data
firestore_delete_documentsDeleteDelete Firestore documents by path.document_paths
firestore_get_documentsReadFetch Firestore documents by path.document_paths
firestore_get_rulesReadGet the active Firestore security rules for the configured project and database.—
firestore_list_collectionsReadList root Firestore collections or subcollections under a document path.—
firestore_query_collectionReadQuery a Firestore collection with optional filters and ordering.collection_path, filters, limit, analyze_query
firestore_update_documentWriteUpdate or merge fields on a Firestore document.document_path, document_data, update_mask, return_data
firestore_validate_rulesReadValidate Firestore security rules source without deploying it.source

Example

Query open support tickets. All four required arguments are included: filters, limit, and analyze_query can be an empty list, a number, and false.

{
  "id": "open-tickets",
  "type": "mcp",
  "name": "Fetch open tickets",
  "tool_name": "firestore_query_collection",
  "tool_args": {
    "collection_path": "support_tickets",
    "filters": [
      {
        "field": "status",
        "op": "EQUAL",
        "value": "open"
      }
    ],
    "limit": 50,
    "analyze_query": false
  },
  "timeout_s": 30
}

Configuration

KeyRequiredDescription
firestore_project_idYesGoogle Cloud project ID that owns the database.
firestore_databaseNoFirestore database ID. Default (default).
firestore_credentials_jsonNoPath to a service account key file. When empty, default Google credentials are used.

Troubleshooting

ProblemWhat to do
Permission deniedGive the service account the Firestore roles it needs on the project, and check firestore_project_id.
"missing firestore project_id"The active profile has no firestore_project_id. Add it on Instance config.
A document is not founddocument_path and collection_path are relative to the configured database. Check the path and the database ID.
A query needs an indexCreate the composite index that Firestore suggests in the error message.
Edit this pageagentruntime-io/agentruntime-docs