MCP Shipyard
← Rules catalog

MCP app widget tool without outputSchema: return structuredContent for the widget

A tool that renders a widget should declare an outputSchema and return structuredContent. Keep widget-only data in _meta, hidden from the model.

majorapps.no-structured-outputChatGPT, Claude

Add an outputSchema to every tool that renders a widget, and return the data the widget needs in structuredContent. The rule apps.no-structured-output is a major finding for ChatGPT and Claude.

What you see

  • A scan reports apps.no-structured-output for the tool: "Tool renders a widget but declares no outputSchema."
  • It fires when the tool has a template URI and its outputSchema is missing or an empty object.

Why it happens

Tools that return only a text block work for chat but give a widget nothing typed to render. OpenAI's server guide splits the result into parts: an outputSchema "when the tool returns structured data", structuredContent as "concise data the model can inspect and use in later calls", and _meta as "client-specific data hidden from the model". The same page warns to treat _meta as hidden from the model, "not as a substitute for authorization or secure storage."

The MCP tools spec says that if an output schema is provided, servers MUST return results that conform to it, and clients SHOULD validate. It also recommends returning the serialised JSON in a text block as well.

Check it yourself

curl -s -X POST https://mcp.acme.example/mcp \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  -H "Authorization: Bearer $TOKEN" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' \
 | jq -r '.result.tools[] | select(._meta.ui.resourceUri != null or ._meta["openai/outputTemplate"] != null) | "\(.name)\t\(.outputSchema != null)"'

Rows ending in false need a schema.

Fix

server.registerTool("show_orders", {
  description: "Show the customer's recent orders in a table. Use when the user asks to see orders.",
  outputSchema: { orders: z.array(z.object({ id: z.string(), status: z.string(), total: z.string() })) },
  _meta: { ui: { resourceUri: "ui://acme-orders/orders.html" } },
}, async () => ({
  structuredContent: { orders },
  content: [{ type: "text", text: "Showing 5 recent orders." }],
  _meta: { rowColors: colors },
}));
  • Put only what the model should reason about in structuredContent.
  • Put layout or display-only data in _meta.
  • Use an object root (output.schema-not-object).

Verify

The jq command shows true for every widget tool, a real call returns structuredContent that validates against the schema, and a re-scan passes.

Which clients care

ChatGPT and Claude, per the rule.

Source

OpenAI MCP server guide: https://developers.openai.com/plugins/build/mcp-server

Run a free scan at https://mcpshipyard.com/scan to check every rule at once.

Check every rule at once

A free scan runs this check and the other 152 against your live URL.

Scan a server