Skip to content

Commit 99622e4

Browse files
jgiuffridaclaude
andcommitted
Address PR review feedback on docs
- Rename "MCP App tool" to "tool with interactive UI" - Clarify why structured_output=True is needed - Recommend Pydantic models for return types Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 5ae83d6 commit 99622e4

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

CLAUDE.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,12 @@ Tools follow a consistent pattern:
2323
4. Context injection via `adapt_context()` — tools receive typed context objects, but MCP only sees user-facing params
2424
5. `register_tools()` in `tools/register.py` — precedence-based enablement (individual > toolset > default)
2525

26-
### MCP Apps
26+
### MCP Apps (tools with interactive UI)
2727

2828
Tools can have associated UIs via the `meta` field:
2929
- `meta={"ui": {"resourceUri": "ui://dbt-mcp/app-name"}}` on `@dbt_mcp_tool`
30-
- `structured_output=True` required — return type must be `TypedDict`
30+
- `structured_output=True` required so the host can pass structured JSON to the UI
31+
- Return type should be a Pydantic model
3132
- Register matching resource with `@dbt_mcp.resource(uri=..., mime_type="text/html;profile=mcp-app")`
3233
- Frontend uses `@modelcontextprotocol/ext-apps` SDK
3334

CONTRIBUTING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,11 @@ Tools are defined using the `@dbt_mcp_tool` decorator and registered with the MC
112112
5. **Add it to the tool list** (e.g., `DISCOVERY_TOOLS`) in the same module
113113
6. The registration function (e.g., `register_discovery_tools`) handles context binding and registration
114114

115-
### Adding an MCP App tool
115+
### Adding a tool with interactive UI (MCP Apps)
116116

117-
MCP Apps are tools that have an associated interactive UI rendered by the host. They build on top of regular tools with two additions:
117+
MCP Apps are tools that have an associated interactive UI rendered by the host (e.g., Claude, VS Code). They build on top of regular tools with two additions:
118118

119-
1. **Use `structured_output=True` and `meta`** to link the tool to a UI resource:
119+
1. **Use `structured_output` and `meta`** to link the tool to a UI resource:
120120
```python
121121
@dbt_mcp_tool(
122122
description=get_prompt("category/tool_name"),
@@ -125,10 +125,10 @@ MCP Apps are tools that have an associated interactive UI rendered by the host.
125125
structured_output=True,
126126
meta={"ui": {"resourceUri": "ui://dbt-mcp/my-app"}},
127127
)
128-
async def my_viz_tool(context: MyToolContext, param: str) -> MyResultType:
128+
async def my_viz_tool(context: MyToolContext, param: str) -> MyResult:
129129
...
130130
```
131-
The return type must be a `TypedDict` when `structured_output=True`.
131+
`structured_output=True` is required so the host can pass structured JSON to the UI. The return type should be a Pydantic model.
132132

133133
2. **Register an MCP resource** at the matching `ui://` URI to serve the HTML app:
134134
```python

0 commit comments

Comments
 (0)