Skip to main content

MCP response format and stability

Glean builds MCP tools for an LLM to call and read. Glean changes tool definitions and tool output as the tools improve, in any release, without a deprecation period. When your code needs a stable request and response schema, use the Glean REST APIs where equivalent functionality is available. They follow Glean's API evolution and deprecation policy.

What's stable and what can change​

Glean separates the MCP protocol, which stays stable, from the content of each tool, which can change.

Stable: the MCP protocol

  • The message structure in the MCP specification for tools, including tools/list, tools/call, and the tool result envelope
  • Any MCP client that follows the specification can list tools, call them, and read results

Can change in any release: tool content

  • Tool names, descriptions, and input parameters
  • The format of response text: Token-Oriented Object Notation (TOON), plain text, Markdown, or JSON
  • Field names, field order, and which fields appear
  • The number, order, and type of content blocks in a result
  • Output from tools that Glean proxies from external MCP servers and connectors

MCP tools compared with REST APIs​

Glean MCP toolsGlean REST APIs
Built forAn LLM that discovers and calls toolsYour code
Response schemaNone. Glean tools don't publish an output schema or return structuredContent.Documented JSON schemas
Breaking changesCan ship in any releaseFollow a deprecation process with a migration period of at least six months
Notice of changesNo advance notice or deprecation periodX-Glean-Deprecated response headers, inline docs warnings, and a published schedule
Testing upcoming changeNot availableThe X-Glean-Exclude-Deprecated-After request header

For details on the REST API process, see API evolution and deprecations.

How Glean formats responses today​

This section lists the formats Glean uses today, with examples of where each one appears, so you can recognize what a host shows you. It isn't a list of every tool, and it isn't a contract. Any tool can move to a different format in any release.

FormatWhat the result containsWhere you see it today
TOONOne text block in TOONMost Glean tools
Text and TOON metadataOne text block: readable text, usually Markdown, then a --- line, then metadata in TOONsearch, chat, read_document, get_agent, and tools that run agents
JSONOne JSON text block in the shape ChatGPT requiresChatGPT search and fetch
Citation JSONOne JSON text block with cited items under resultsEvery tool on a server with Microsoft 365 Copilot citation format on
Images and resourcesImage blocks or resource links, with text metadataImage tools, and read_document in hosts that support embedded resources

The TOON format holds the same data as JSON in fewer tokens, so the model gets more context from each tool call. A search result in TOON can look like this:

results[2]{title,url,datasource}:
Q3 planning notes,https://example.com/docs/q3-plan,gdrive
Launch checklist,https://example.com/docs/launch,confluence

A result can also contain extra content blocks. For example, a response can end with a block that holds an invocation ID. See Find invocation IDs in MCP tool responses.

Microsoft 365 Copilot citation format​

Microsoft 365 Copilot cites a tool result only when it can read the result as JSON and find items with a URL. TOON doesn't give it that, so Glean results in Microsoft 365 Copilot can appear without citations. Turn on Microsoft 365 Copilot citation format for the server that Microsoft 365 Copilot connects to. Every tool on that server then returns one JSON text block, with the cited items under results.

The setting is off by default because the citation JSON costs more tokens than TOON for the same results, which leaves the model less room for other context in a session. Other hosts don't need the JSON shape, so only turn it on for a server that Microsoft 365 Copilot uses. The setting applies only to the server you change. The Glean-provided default server always uses the default formats.

  1. Go to Admin console → Platform → Glean MCP servers and select the MCP servers tab.
  2. Click the server name to open its configuration.
  3. Turn on Microsoft 365 Copilot citation format.

You can also turn it on when you create a server. Like every format on this page, the citation JSON shape can change in any release.

Choose an interface​

What you're buildingUse
An AI host or agent where the model calls Glean toolsGlean MCP server
Search results in your own UI or data pipelinePlatform API: Search
A chat experience that renders Glean answers in your own UIPlatform API: Chat
An app or workflow that runs a Glean agent and uses its outputPlatform API: Agents
A capability that isn't in the Platform API yetClient API

For more guidance, see Choose a retrieval interface.

If your integration parses MCP responses​

Move the integration to the matching REST API. Until you do, any Glean release can break it.

While you migrate, make the parser tolerant of change:

  • Read every text block in a result, not one block at a fixed position.
  • Don't parse response text as a JSON document, and don't extract fields from model-facing text.
  • Don't depend on the number or order of content blocks, or on the TOON layout.
  • Ignore a text block that starts with glean_invocation_id:. If you need the ID, read it from _meta["glean/invocationId"].

See also​