Skip to content

fix: return select query responses without SDK model parsing - #126

Merged
ChiragAgg5k merged 1 commit into
mainfrom
fix/select-untyped-response
Oct 6, 2026
Merged

ChiragAgg5k merged 1 commit into
mainfrom
fix/select-untyped-response

Conversation

@ChiragAgg5k

Copy link
Copy Markdown
Member

A select query makes Appwrite return only the chosen attributes for each item in a list. The Console SDK still validates that response against the full model, where every attribute is required, so a successful call raises Unable to parse response into DeploymentList (Sentry MCP-12 and MCP-13, about 760 events, still firing on 1.0.3). The agent made a valid request and the server answered it, but the tool call reports a failure.

When a tool call's queries include a select, execute_registered_tool now replaces the service instance's _parse_response with a passthrough, so the SDK returns the response dict as-is. The server already serialises models back to JSON for the client, so the agent gets the same data it asked for. Calls without select are unchanged and still parse into typed models.

This is deliberately limited to select: that's the one case where partial responses are expected by design rather than a contract bug, so other parse failures keep surfacing in Sentry.

Tests: test_execute_registered_tool_returns_selected_attributes_untyped runs the real functions_list_deployments tool against a partial response. With select it returns the raw payload, and without select it still fails. It errors without the fix.

Verification: ruff check, black --check and pyright are clean, and python -m unittest discover -s tests/unit passes.

@hansi-codes

hansi-codes Bot commented Oct 6, 2026

Copy link
Copy Markdown

🟢 Tier S · Ready to merge

The change is scoped to a fresh service instance per call, preserves existing error handling and serialization, and has a focused regression test; no concrete defects were found.

Calls whose queries include select now bypass SDK response-model parsing and return the raw payload through the existing result formatter. Calls without select retain typed parsing. A regression test covers partial deployment responses and verifies that parsing failures still surface without select.

Verdict New comments Fixed Still open
✅ Approved 0 0 0
📂 Walkthrough · 2
File Change
src/mcp_server_appwrite/server.py Detect select queries and use a response passthrough on the per-call SDK service instance.
tests/unit/test_server.py Verify partial deployment payloads succeed with select and still fail model parsing without it.

Reviewed 17ff437 · Details · Comment @hansi-codes review to re-run, or mention @hansi-codes with a question.

@hansi-codes hansi-codes Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Tier S · Looks good to merge. Summary

@ChiragAgg5k
ChiragAgg5k merged commit 984d6fc into main Oct 6, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant