Tool: execute_graphql_read
Executes a read-only GraphQL query against a Firebase SQL Connect Service instance.
Grants read access to the connected data sources. Identical to execute_graphql except it only accepts read-only queries.
When to use it:
- Use this tool to execute read-only GraphQL queries (fetching records, filtering, listing data).
How to use it:
- Call
execute_graphql_readwithprojectId,location,serviceIdto identify the service, and provide the GraphQLquerystring. - Optionally provide
variables,operationName, andextensions.
JSON Example:
{
"projectId": "my-project",
"location": "us-central1",
"serviceId": "my-service",
"query": "query GetUser($id: UUID!) { user(id: $id) { name } }",
"variables": {
"id": "123e4567-e89b-12d3-a456-426614174000"
}
}
The following code sample shows how to use curl to call the execute_graphql_read MCP tool.
| Curl Request |
|---|
curl --location 'https://firebasedataconnect.googleapis.com/mcp' \ --header 'content-type: application/json' \ --header 'accept: application/json, text/event-stream' \ --data '{ "method": "tools/call", "params": { "name": "execute_graphql_read", "arguments": { // provide these details according to the tool's MCP specification } }, "jsonrpc": "2.0", "id": 1 }' |
Input Schema
Request message for ExecuteGraphql facade.
ExecuteGraphqlRequest
| JSON representation |
|---|
{ "projectId": string, "location": string, "serviceId": string, "query": string, "variables": { object }, "extensions": { object ( |
| Fields | |
|---|---|
projectId |
Required. The project ID or number. |
location |
Required. The location of the service. |
serviceId |
Required. Identifier. The service ID. |
query |
Required. The GraphQL query document source. |
variables |
Optional. Values for GraphQL variables provided in this request. |
extensions |
Optional. Additional GraphQL request information. |
Union field
|
|
operationName |
Optional. The name of the GraphQL operation name. |
Struct
| JSON representation |
|---|
{ "fields": { string: value, ... } } |
| Fields | |
|---|---|
fields |
Unordered map of dynamically typed values. An object containing a list of |
FieldsEntry
| JSON representation |
|---|
{ "key": string, "value": value } |
| Fields | |
|---|---|
key |
|
value |
|
Value
| JSON representation |
|---|
{ // Union field |
| Fields | |
|---|---|
Union field kind. The kind of value. kind can be only one of the following: |
|
nullValue |
Represents a JSON |
numberValue |
Represents a JSON number. Must not be |
stringValue |
Represents a JSON string. |
boolValue |
Represents a JSON boolean ( |
structValue |
Represents a JSON object. |
listValue |
Represents a JSON array. |
ListValue
| JSON representation |
|---|
{ "values": [ value ] } |
| Fields | |
|---|---|
values[] |
Repeated field of dynamically typed values. |
GraphqlRequestExtensions
| JSON representation |
|---|
{
"impersonate": {
object ( |
| Fields | |
|---|---|
impersonate |
Optional. If set, impersonate a request with given Firebase Auth context and evaluate the auth policies on the operation. If omitted, bypass any defined auth policies. |
Impersonation
| JSON representation |
|---|
{ "includeDebugDetails": boolean, // Union field |
| Fields | |
|---|---|
includeDebugDetails |
Optional. If set, include debug details in GraphQL error extensions. |
Union field kind. The kind of impersonation. kind can be only one of the following: |
|
unauthenticated |
Evaluate the auth policy as an unauthenticated request. Can only be set to true. |
authClaims |
Evaluate the auth policy with a customized JWT auth token. Should follow the Firebase Auth token format. https://firebase.google.com/docs/rules/rules-and-auth For example: a verified user may have auth_claims of {"sub": |
NullValue
Represents a JSON null.
NullValue is a sentinel, using an enum with only one value to represent the null value for the Value type union.
A field of type NullValue with any value other than 0 is considered invalid. Most ProtoJSON serializers will emit a Value with a null_value set as a JSON null regardless of the integer value, and so will round trip to a 0 value.
| Enums | |
|---|---|
NULL_VALUE |
Null value. |
Output Schema
The GraphQL response from Firebase SQL Connect.
It strives to match the GraphQL over HTTP spec. Note: Firebase SQL Connect always responds with Content-Type:
application/json. https://github.com/graphql/graphql-over-http/blob/main/spec/GraphQLOverHTTP.md#body
GraphqlResponse
| JSON representation |
|---|
{ "data": { object }, "errors": [ { object ( |
| Fields | |
|---|---|
data |
The result of the execution of the requested operation. If an error was raised before execution begins, the data entry should not be present in the result. (a request error: https://spec.graphql.org/draft/#sec-Errors.Request-Errors) If an error was raised during the execution that prevented a valid response, the data entry in the response should be null. (a field error: https://spec.graphql.org/draft/#sec-Errors.Error-Result-Format) |
errors[] |
Errors of this response. If the data entry in the response is not present, the errors entry must be present. It conforms to https://spec.graphql.org/draft/#sec-Errors . |
extensions |
Additional response information. It conforms to https://spec.graphql.org/draft/#sec-Extensions . |
Struct
| JSON representation |
|---|
{ "fields": { string: value, ... } } |
| Fields | |
|---|---|
fields |
Unordered map of dynamically typed values. An object containing a list of |
FieldsEntry
| JSON representation |
|---|
{ "key": string, "value": value } |
| Fields | |
|---|---|
key |
|
value |
|
Value
| JSON representation |
|---|
{ // Union field |
| Fields | |
|---|---|
Union field kind. The kind of value. kind can be only one of the following: |
|
nullValue |
Represents a JSON |
numberValue |
Represents a JSON number. Must not be |
stringValue |
Represents a JSON string. |
boolValue |
Represents a JSON boolean ( |
structValue |
Represents a JSON object. |
listValue |
Represents a JSON array. |
ListValue
| JSON representation |
|---|
{ "values": [ value ] } |
| Fields | |
|---|---|
values[] |
Repeated field of dynamically typed values. |
GraphqlError
| JSON representation |
|---|
{ "message": string, "locations": [ { object ( |
| Fields | |
|---|---|
message |
The detailed error message. The message should help developer understand the underlying problem without leaking internal data. |
locations[] |
The source locations where the error occurred. Locations should help developers and toolings identify the source of error quickly. Included in admin endpoints ( Omitted in |
path |
The result field which could not be populated due to error. Clients can use path to identify whether a null result is intentional or caused by a runtime error. It should be a list of string or index from the root of GraphQL query document. |
extensions |
Additional error information. |
SourceLocation
| JSON representation |
|---|
{ "line": integer, "column": integer } |
| Fields | |
|---|---|
line |
Line number starting at 1. |
column |
Column number starting at 1. |
GraphqlErrorExtensions
| JSON representation |
|---|
{ "file": string, "code": enum ( |
| Fields | |
|---|---|
file |
The source file name where the error occurred. Included only for |
code |
Maps to canonical gRPC codes. If not specified, it represents |
debugDetails |
More detailed error message to assist debugging. It contains application business logic that are inappropriate to leak publicly. In the emulator, SQL Connect API always includes it to assist local development and debugging. In the backend, ConnectorService always hides it. GraphqlService without impersonation always include it. GraphqlService with impersonation includes it only if explicitly opted-in with |
warningLevel |
Warning level describes the severity and required action to suppress this warning when Firebase CLI run into it. |
workarounds[] |
Workarounds provide suggestions to address the compile errors or warnings. |
Workaround
| JSON representation |
|---|
{ "description": string, "reason": string, "replace": string } |
| Fields | |
|---|---|
description |
Description of this workaround. |
reason |
Why would this workaround address the error and warning. |
replace |
A suggested code snippet to fix the error and warning. |
GraphqlResponseExtensions
| JSON representation |
|---|
{
"dataConnect": [
{
object ( |
| Fields | |
|---|---|
dataConnect[] |
SQL Connect specific GraphQL extension, a list of paths and properties. |
DataConnectProperties
| JSON representation |
|---|
{ "path": array, "entityId": string, "entityIds": [ string ], "maxAge": string } |
| Fields | |
|---|---|
path |
The path under response.data where the rest of the fields apply. Each element may be a string (field name) or number (array index). The root of response.data is denoted by the empty list |
entityId |
A single Entity ID. Set if the path points to a single entity. |
entityIds[] |
A list of Entity IDs. Set if the path points to an array of entities. An ID is present for each element of the array at the corresponding index. |
maxAge |
The server-suggested duration before data under path is considered stale. A duration in seconds with up to nine fractional digits, ending with ' |
Duration
| JSON representation |
|---|
{ "seconds": string, "nanos": integer } |
| Fields | |
|---|---|
seconds |
Signed seconds of the span of time. Must be from -315,576,000,000 to +315,576,000,000 inclusive. Note: these bounds are computed from: 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
nanos |
Signed fractions of a second at nanosecond resolution of the span of time. Durations less than one second are represented with a 0 |
NullValue
Represents a JSON null.
NullValue is a sentinel, using an enum with only one value to represent the null value for the Value type union.
A field of type NullValue with any value other than 0 is considered invalid. Most ProtoJSON serializers will emit a Value with a null_value set as a JSON null regardless of the integer value, and so will round trip to a 0 value.
| Enums | |
|---|---|
NULL_VALUE |
Null value. |
Code
The canonical error codes for gRPC APIs.
Sometimes multiple error codes may apply. Services should return the most specific error code that applies. For example, prefer OUT_OF_RANGE over FAILED_PRECONDITION if both codes apply. Similarly prefer NOT_FOUND or ALREADY_EXISTS over FAILED_PRECONDITION.
| Enums | |
|---|---|
OK |
Not an error; returned on success. HTTP Mapping: 200 OK |
CANCELLED |
The operation was cancelled, typically by the caller. HTTP Mapping: 499 Client Closed Request |
UNKNOWN |
Unknown error. For example, this error may be returned when a HTTP Mapping: 500 Internal Server Error |
INVALID_ARGUMENT |
The client specified an invalid argument. Note that this differs from HTTP Mapping: 400 Bad Request |
DEADLINE_EXCEEDED |
The deadline expired before the operation could complete. For operations that change the state of the system, this error may be returned even if the operation has completed successfully. For example, a successful response from a server could have been delayed long enough for the deadline to expire. HTTP Mapping: 504 Gateway Timeout |
NOT_FOUND |
Some requested entity (e.g., file or directory) was not found. Note to server developers: if a request is denied for an entire class of users, such as gradual feature rollout or undocumented allowlist, HTTP Mapping: 404 Not Found |
ALREADY_EXISTS |
The entity that a client attempted to create (e.g., file or directory) already exists. HTTP Mapping: 409 Conflict |
PERMISSION_DENIED |
The caller does not have permission to execute the specified operation. HTTP Mapping: 403 Forbidden |
UNAUTHENTICATED |
The request does not have valid authentication credentials for the operation. HTTP Mapping: 401 Unauthorized |
RESOURCE_EXHAUSTED |
Some resource has been exhausted, perhaps a per-user quota, or perhaps the entire file system is out of space. HTTP Mapping: 429 Too Many Requests |
FAILED_PRECONDITION |
The operation was rejected because the system is not in a state required for the operation's execution. For example, the directory to be deleted is non-empty, an rmdir operation is applied to a non-directory, etc. Service implementors can use the following guidelines to decide between HTTP Mapping: 400 Bad Request |
ABORTED |
The operation was aborted, typically due to a concurrency issue such as a sequencer check failure or transaction abort. See the guidelines above for deciding between HTTP Mapping: 409 Conflict |
OUT_OF_RANGE |
The operation was attempted past the valid range. E.g., seeking or reading past end-of-file. Unlike There is a fair bit of overlap between HTTP Mapping: 400 Bad Request |
UNIMPLEMENTED |
The operation is not implemented or is not supported/enabled in this service. HTTP Mapping: 501 Not Implemented |
INTERNAL |
Internal errors. This means that some invariants expected by the underlying system have been broken. This error code is reserved for serious errors. HTTP Mapping: 500 Internal Server Error |
UNAVAILABLE |
The service is currently unavailable. This is most likely a transient condition, which can be corrected by retrying with a backoff. Note that it is not always safe to retry non-idempotent operations. See the guidelines above for deciding between HTTP Mapping: 503 Service Unavailable |
DATA_LOSS |
Unrecoverable data loss or corruption. HTTP Mapping: 500 Internal Server Error |
WarningLevel
WarningLevel describes the severity and required action to suppress this warning when Firebase CLI run into it.
| Enums | |
|---|---|
WARNING_LEVEL_UNKNOWN |
Warning level is not specified. |
LOG_ONLY |
Display a warning without action needed. |
INTERACTIVE_ACK |
Request a confirmation in interactive deployment flow. |
REQUIRE_ACK |
Require an explicit confirmation in all deployment flows. |
REQUIRE_FORCE |
Require --force in all deployment flows. |
Tool Annotations
Tool annotations are sent to MCP clients to describe the basic risk of a given tool. Most clients treat these hints as untrusted, but they can be used to decide when a confirmation prompt might be sent to a user.
Along with the title string, the following boolean hints are defined as follows:
readOnlyHint: If true, the tool doesn't modify its environment. Default: false.destructiveHint: If true, then the tool can perform destructive actions. If false, then the tool can only perform additive actions. Default: true.idempotentHint: If true, then calling the tool repeatedly with the same arguments will have no additional effect on its environment. Default: false.openWorldHint: If true, then the tool can interact with an 'open world' of external entities. If false, then the tool can only interact with internal entities. For example, a web search tool would be open world, while a memory tool would not be open world.
Destructive Hint: ❌ | Idempotent Hint: ✅ | Read Only Hint: ✅ | Open World Hint: ❌