Skip to content

add fetch_url tool to CMSCompOpsAgent#502

Draft
harz05 wants to merge 1 commit intoarchi-physics:mainfrom
harz05:feat/fetch-url-tool
Draft

add fetch_url tool to CMSCompOpsAgent#502
harz05 wants to merge 1 commit intoarchi-physics:mainfrom
harz05:feat/fetch-url-tool

Conversation

@harz05
Copy link
Copy Markdown

@harz05 harz05 commented Mar 5, 2026

Summary

Closes #451.

As noted by @lucalavezzo in #451, @hassan11196 already implemented an HTTP GET tool as part of the larger sandboxing feature in #433. This PR extracts just the fetch_url tool from that work and merges it independently, so the agent can fetch live URLs without needing the full Docker sandbox infrastructure.

The implementation is adapted from the http_get.py introduced in #433, refactored to match the existing tool factory pattern (create_fetch_url_tool) and wired into CMSCompOpsAgent cleanly.


Changes

File Description
src/archi/pipelines/agents/tools/fetch_url.py New file: create_fetch_url_tool() factory
src/archi/pipelines/agents/tools/__init__.py Export create_fetch_url_tool
src/archi/pipelines/agents/cms_comp_ops_agent.py Register fetch_url in _tool_definitions() + _build_fetch_url_tool() builder
examples/agents/cms-comp-ops.md Add fetch_url to the agent spec tools list

How it works

  • Factory function create_fetch_url_tool() follows the same pattern as other tools in the codebase (create_retriever_tool, create_file_search_tool, etc.)
  • Makes an HTTP GET request using requests (already a project dependency, no new deps)
  • Only http:// and https:// schemes accepted
  • Credentials are stripped from URLs in logs and error messages
  • Response truncated at max_response_chars (default 40 000) to avoid context window overflow
  • RBAC permission tools:http_get enforced via @require_tool_permission (set required_permission=None to disable)
  • Returns descriptive error strings on failure (timeouts, 4xx/5xx, connection errors) so the agent handles them gracefully without raising
  • store_tool_input callback supported for tracing

Usage

Enable via agent spec:

tools:
  - fetch_url

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.

Fetch URL tool

1 participant