Firestore connector
Read, write, and query Cloud Firestore documents and check security rules from AgentRuntime workflows.
En esta página
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
- 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. - 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.
- 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_idand, if you use a named database,firestore_database. See the warning below aboutfirestore_credentials_json. Set Status to Active — can be used in workflows and click Save. Then click Use this profile for workflows. - Test it
In Workflow Studio, add the
firestore_list_collectionstool 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 noparent_pathit lists the top-level collections.
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.
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_documentmerges profile fields into an existing document, limited byupdate_mask. - Ops dashboard.
firestore_query_collectionfinds open items, and an LLM step turns them into a daily summary. - Rules check.
firestore_validate_ruleschecks a proposed rules file, and the workflow stops ifvalidisfalse.
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.
| Tool | Access | What it does | Required arguments |
|---|---|---|---|
firestore_add_documents | Write | Add a document with an auto-generated ID to a Firestore collection. | collection_path, document_data, return_data |
firestore_delete_documents | Delete | Delete Firestore documents by path. | document_paths |
firestore_get_documents | Read | Fetch Firestore documents by path. | document_paths |
firestore_get_rules | Read | Get the active Firestore security rules for the configured project and database. | — |
firestore_list_collections | Read | List root Firestore collections or subcollections under a document path. | — |
firestore_query_collection | Read | Query a Firestore collection with optional filters and ordering. | collection_path, filters, limit, analyze_query |
firestore_update_document | Write | Update or merge fields on a Firestore document. | document_path, document_data, update_mask, return_data |
firestore_validate_rules | Read | Validate 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
| Key | Required | Description |
|---|---|---|
firestore_project_id | Yes | Google Cloud project ID that owns the database. |
firestore_database | No | Firestore database ID. Default (default). |
firestore_credentials_json | No | Path to a service account key file. When empty, default Google credentials are used. |
Troubleshooting
| Problem | What to do |
|---|---|
| Permission denied | Give 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 found | document_path and collection_path are relative to the configured database. Check the path and the database ID. |
| A query needs an index | Create the composite index that Firestore suggests in the error message. |
Related
- MCP instances
- Connections
- Integrations quickstart
- MongoDB connector for another document database
- Connector catalog
- Troubleshooting