refactor: migrate tool outputs to use EmbeddedResource with typed JSON for assistant-facing data
This commit is contained in:
@@ -21,12 +21,12 @@ This document records key architectural and design decisions made during the dev
|
||||
- Initial authentication is handled via a separate `auth` script or integrated OAuth flow.
|
||||
|
||||
## 3. Data Representation & MCP Annotations
|
||||
**Decision**: Use dual-content outputs with audience-specific annotations.
|
||||
**Context**: To provide a clean user experience while giving the LLM detailed data, we split tool results into two parts.
|
||||
**Decision**: Use dual-content outputs with audience-specific annotations and native MIME typing.
|
||||
**Context**: To provide a clean user experience while giving the LLM detailed data, we split tool results into two parts and use protocol-level typing.
|
||||
**Implementation**:
|
||||
- **User Facing**: Markdown summaries annotated with `audience=["user"]`.
|
||||
- **Assistant Facing**: Raw JSON data annotated with `audience=["assistant"]`.
|
||||
- This allows MCP clients to intelligently decide what to display to the user while ensuring the assistant receives full technical context.
|
||||
- **User Facing**: Markdown summaries annotated with `audience=["user"]` using `TextContent`.
|
||||
- **Assistant Facing**: Raw JSON data provided as an `EmbeddedResource` with `mimeType="application/json"` and annotated with `audience=["assistant"]`.
|
||||
- This ensures the LLM explicitly knows the data format while allowing clients to optimize the user-facing UI.
|
||||
|
||||
## 4. Internationalization
|
||||
**Decision**: Use metric units (meters, km, m/s) internally and provide clear conversion instructions to the LLM.
|
||||
|
||||
Reference in New Issue
Block a user