Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[MCP Tool] Implement ability to specify outputSchema on tools

Aperta
#786 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@swapnil-nagar ci sta già lavorando.

Dal 14/4/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

area:nodejs-functions mcp-extension

Implement support for specifying an outputSchema on MCP tool definitions. This allows tools to declare the JSON schema of their structured output, enabling clients to validate and better understand tool responses.

Background

The MCP specification allows tools to declare an output schema that describes the structure of the tool's return value. This is separate from the input schema (which describes the tool's parameters).

MCP Specification: https://modelcontextprotocol.io/specification/2025-06-18/server/tools#output-schema

Output Schema: Worker ↔ Host Contract (based off of this PR)

1. Worker side — configuration

The user calls the fluent builder:

builder.ConfigureMcpTool("MyTool")
    .WithOutputSchema("""{ "type": "object", "properties": { ... } }""");

WithOutputSchema validates the JSON string and stores it as McpOutputSchema on ToolOptions.

2. Worker side — metadata emission

During function metadata transformation, ResolveToolOutputSchemaExtension reads ToolOptions.OutputSchema and writes its validated JSON string onto McpParsedBinding.OutputSchema. McpBindingBuilder.Build() then injects it into the raw binding JSON under the key:

"outputSchema": "<validated json string>"

No flag (analogous to useWorkerInputSchema) is needed — if the key is present there is a schema; if absent, there isn't.

3. Host side — reading the contract

McpToolTriggerAttribute exposes OutputSchema (string?) populated from the raw binding JSON. McpToolTriggerBinding.GetOutputSchema() parses and validates it, requiring:

  • Valid JSON
  • Root must be type: "object" (validated via McpInputSchemaJsonUtilities.IsValidMcpToolJsonSchema)

The resulting JsonElement? is passed to McpToolListener, which advertises it as the tool's outputSchema in the MCP tools/list response.

Summary
Step Location Binding key
User configures schema McpToolBuilder.WithOutputSchema() (worker) —
Schema validated + stored McpOutputSchema / McpToolSchemaValidator (worker) —
Schema written to raw binding ResolveToolOutputSchemaExtension → McpBindingBuilder (worker) outputSchema
Host reads from binding attr McpToolTriggerAttribute.OutputSchema (host) outputSchema
Host validates + registers McpToolTriggerBinding.GetOutputSchema() (host) —
Host advertises to MCP client McpToolListener → tools/list response (host) outputSchema in tool descriptor
Lingua principale
TypeScript
Stelle
110
Fork
52
Merge medio
1g 4h
PR unite (30g)
2

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Azure/azure-functions-nodejs-worker

Tutte le issue di Azure/azure-functions-nodejs-worker

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.