MCP Tools Reference: firebasedataconnect.googleapis.com

Tool: generate_schema

Generates a GraphQL schema based on a natural language prompt or data description.

When to use it:

  • Use this tool to scaffold new GraphQL schema types and tables using natural language prompts.

How to use it:

  • Call generate_schema with projectId, location, and prompt.
  • Use list_locations to find a valid location for location (any location works; choosing a closer region reduces latency).

JSON Example:

{
          "projectId": "my-project",
          "location": "us-central1",
          "prompt": "Create a blog schema with Users, Posts, and Comments"
        }
        

The following code sample shows how to use curl to call the generate_schema 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": "generate_schema",
    "arguments": {
      // provide these details according to the tool's MCP specification
    }
  },
  "jsonrpc": "2.0",
  "id": 1
}'

Input Schema

Request message for GenerateSchema facade.

GenerateSchemaRequest

JSON representation
{
  "projectId": string,
  "location": string,
  "prompt": string
}
Fields
projectId

string

Required. The project ID or number.

location

string

Required. The location of the service.

prompt

string

Required. The natural language description of the data model to generate.

Output Schema

Output for streaming generate schema requests

GenerateSchemaResponse

JSON representation
{

  // Union field output_chunk can be only one of the following:
  "status": {
    object (GenerationStatus)
  },
  "part": {
    object (Part)
  }
  // End of list of possible types for union field output_chunk.
}
Fields
Union field output_chunk. The streamed output chunk from the generation process. output_chunk can be only one of the following:
status

object (GenerationStatus)

Essential for providing responsive UI feedback (e.g., a spinner or "Analyzing schema..." step).

part

object (Part)

The content from the current conversational turn.

GenerationStatus

JSON representation
{
  "state": enum (State),
  "message": string
}
Fields
state

enum (State)

Output only. The state of generation.

message

string

Output only. A message providing more details about the state.

Part

JSON representation
{

  // Union field data can be only one of the following:
  "textChunk": {
    object (TextChunk)
  },
  "codeChunk": {
    object (CodeChunk)
  }
  // End of list of possible types for union field data.
}
Fields
Union field data. The content from the current conversational turn. data can be only one of the following:
textChunk

object (TextChunk)

Optional. A chunk of text.

codeChunk

object (CodeChunk)

Optional. A chunk of code.

TextChunk

JSON representation
{
  "text": string
}
Fields
text

string

Required. The text content string.

CodeChunk

JSON representation
{
  "code": string,
  "languageCode": string
}
Fields
code

string

Required. The code content string.

languageCode

string

Optional. Specifies the language if we expand support beyond GraphQL (e.g., SQL or JSON) The standard is BCP-47 language code.

State

Represents the state of generation.

Enums
STATE_UNSPECIFIED Unspecified state.
ANALYZING_CODE The agent is analyzing schema or operations.
GENERATING_CODE The agent is generating code
COMPLETED Generation is complete.

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: ❌