Developers · MCP outputSchema

Say what your MCP tools return

Declare an outputSchema on your MCP tools and return structuredContent, so the ChatWith chat can send users to a page filled with what a tool returned.

Why ChatWith needs it

When the chat runs one of your tools, you choose what it offers next: nothing, Refresh page, or Navigate to a page of your site. A page can take values from what the tool returned, such as /orders/{id}.

ChatWith only knows those values if the tool says what it returns. A tool that doesn't declare it can only offer Refresh page, and the dashboard shows a warning on it.

Declare outputSchema in tools/list

MCP lets every tool describe its result with an outputSchema, a JSON Schema for one object. List it next to inputSchema:

{
  "name": "create_order",
  "description": "Create an order for the signed-in user.",
  "inputSchema": { "type": "object", "properties": { "sku": { "type": "string" } }, "required": ["sku"] },
  "outputSchema": {
    "type": "object",
    "properties": {
      "id": { "type": "string" },
      "status": { "type": "string" },
      "customer": { "type": "object", "properties": { "id": { "type": "string" } } }
    }
  }
}

ChatWith reads each field and each field one level down, so this tool offers {id}, {status}, {customer} and {customer.id} to the page.

Return structuredContent

A tool that declares an outputSchema returns its result as structuredContent, an object that matches the schema. Keep the same object as text in content for clients that only read text:

{
  "content": [{ "type": "text", "text": "{\"id\":\"A-1042\",\"status\":\"created\"}" }],
  "structuredContent": { "id": "A-1042", "status": "created" }
}

The chat fills the page from structuredContent. When a value the page needs is missing from a reply, it offers Refresh page instead.

Then connect it again

Open the assistant's MCP screen and press Validate. ChatWith reads tools/list again, and Navigate to opens on every tool that now declares what it returns.

The full rules are in the MCP specification on output schemas. ChatWith's own server declares one on every tool that returns an object: see its tool reference.

Keep building

More developer docs.

MCP use cases

Eight workflows on the tools, from answering docs to client workspaces.

See MCP use cases

Let your users use your MCP inside your app.

No outside AI subscription for them. One snippet for you.

Plans from $29 a month · Change or cancel anytime