You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Return dict from get_data_sources and get_artifact_relationships
The April refactor that switched search tools to dict (commit 28f4681)
missed these two — they kept calling json.dumps(...) without
ensure_ascii=False, so Cyrillic and other non-ASCII content reached
clients escaped as \uXXXX sequences. Returning the dict (or list)
directly lets FastMCP serialize through pydantic_core.to_json, which
preserves UTF-8.
Also tighten the convention in CLAUDE.md: only fetch_artifacts returns
XML; every other tool returns dict/list. Add an explicit "never call
json.dumps from a tool's return path" rule with the rationale, plus
e2e UTF-8 round-trip tests for the four metadata tools so this
regression is caught next time. Drop the unused
transform_*_response_to_json aliases.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4. Tool translates MCP call to CodeAlive API request (with `X-CodeAlive-*` headers)
121
-
5. Response parsed, formatted as XML or text, returned to AI client
121
+
5. Response parsed and returned to the AI client — as a `dict` for metadata/discovery tools, as an XML string for `fetch_artifacts`, or as plain text for `chat`
122
122
123
123
### Environment Variables
124
124
@@ -205,18 +205,26 @@ When adding a new tool, ensure:
205
205
206
206
## Tool Response Conventions
207
207
208
-
### Response format: dict for metadata, XML for content
209
-
210
-
Tools that return **search metadata** (identifiers, match counts, line numbers)
211
-
return a `dict`. FastMCP serializes it automatically via `pydantic_core.to_json`,
212
-
which preserves Unicode — no manual `json.dumps()` needed. Examples:
0 commit comments