Repository navigation
[Deep Agent 13/15] Curated Utils-Server tools via the Jarvis Registry MCP gateway (#47) - #62
Open
stavp-star wants to merge 2 commits into
Open
stavp-star wants to merge 2 commits into
stavp-star wants to merge 2 commits into
Conversation
…gateway
- utils_mcp.py: load allow-listed tools from {JARVIS_GATEWAY_URL}/mcp/
{namespace}/ (ApiKey auth) with langchain-mcp-adapters, timeout and
graceful fallback; per-agent allocation (main: relative dates, Hebrew
normalisation, spatial-expression check; value-resolver: + geo buffer /
validation); no SQL execution through Utils-Server
- tools wrapped in the {ok, data, error} envelope; gateway errors ->
EXTERNAL_TOOL_ERROR
- acreate_deep_agent() loads them; CLI and benchmark use it
- skills: when/how to use them (relative-date tool returns an instant,
not a period; buffers come back as GeoJSON)
- langchain-mcp-adapters pinned <0.3 (0.3 needs a newer mcp SDK)
Closes #47
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
2 of 5 tasks
…ep-agent/47-utils-mcp Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 20, 2026
benb-mafat
reviewed
Oct 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #47 · Part of epic #49 · Stack position 13/15. Base:
deep-agent/48-subagents-prompts(#61), auto-retargets on merge.What
deep_agent/utils_mcp.pyloads a curated subset of Utils-Server tools from the Jarvis Registry gateway. I followed the registry's own deepagents sandbox (jarvis-registry/src/app/api/v1/endpoints/sandbox.py) andUtils-Server/docs/registry-integration.md.Connection:
langchain-mcp-adaptersstreamable HTTP to{JARVIS_GATEWAY_URL}/mcp/{JARVIS_MCP_NAMESPACE}/(default namespaceglobal), withAuthorization: ApiKey <JARVIS_API_KEY>, the gateway's API-key scheme.Allow-list and allocation. Each tool goes only to the agent that needs it:
datetime_parse_relative_expression,text_normalize,trino_validate_spatial_expressiondatetime_parse_relative_expression,text_normalize,geo_create_buffer,geo_validate_geometryGateway names are matched after sanitising, including namespaced forms like
utils__text_normalize. Write tools andtrino_run_queryare never exposed: all SQL stays on the guardedexecute_trino_querypath ([Deep Agent 3/15] Enforce read-only SQL, AST-level LIMIT and safe identifiers (#35) #52).Envelope: every tool is wrapped in
{ok, data, error}. Gateway errors ({"error", "status_code", "response_text"}) and exceptions becomeEXTERNAL_TOOL_ERROR, with the hint "continue without it".Graceful degradation: with no URL, an unreachable gateway, or a timeout (
UTILS_MCP_TIMEOUT_S, default 10 s), the agent starts without these tools and logs why. Allow-listed tools missing on the gateway (e.g. still pending approval) are logged by name.acreate_deep_agent()loads the tools; the CLI anddeep-agent-benchuse it.create_deep_agent(extra_tools=...)stays sync for tests and embedding.Skills, scoped to what the tools actually do (checked against the Utils-Server source):
temporal-analyst:datetime_parse_relative_expressionresolves point-in-time Hebrew phrases (לפני 3 ימים, יום ראשון הבא). It returns an instant, not a period ("חודש שעבר" = one month ago) and rejects "השבוע", so the skill's period rules still build the bounds.spatial-analyst:trino_validate_spatial_expressionchecks that an expression is valid and its functions exist, and can evaluate it on one row.geo_create_bufferreturns GeoJSON, used withfrom_geojson_geometry(...).Dependency:
langchain-mcp-adapters>=0.2,<0.3. 0.3.0 importsstreamable_http_client, which needs a newermcpSDK than the locked 1.12.4. Bumpingmcpwould touch the Jeen client the legacy graph uses, so that's left for a separate change.Acceptance criteria
datetime_parse_relative_expressionin traces; the Hebrew "this week" case returns Sunday-start bounds. Partial: the tool can't produce periods, so the Sunday bounds come from the skill ([Deep Agent 11/15] One owner per topic, fix incorrect skill guidance, lint it in CI (#40) #60). Trace evidence is pending live gateway access.trino_validate_spatial_expressionbefore execution (in traces). Pending live.latency_mson gateway errors). The p50/p95 report is pending live.Definition of done: pending (infra / registry admin)
trino:read,geo:read,text:read,datetime:read, and approve the 5 tools in the registryTesting
tests/deep_agent/test_utils_mcp.py: 12 tests (connection, allocation, allow-list exclusions, de-duplication, envelope, error mapping, degradation, offered tools in-agent and per subagent)🤖 Generated with Claude Code