Skip to content

Add agent_api_root and search_scope configuration options - #212

Merged
keyurva merged 3 commits into
datacommonsorg:mainfrom
keyurva:dc-agent-api-root
Jul 24, 2026
Merged

Add agent_api_root and search_scope configuration options#212
keyurva merged 3 commits into
datacommonsorg:mainfrom
keyurva:dc-agent-api-root

Conversation

@keyurva

@keyurva keyurva commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add DC_AGENT_API_ROOT environment variable and configuration setting for Agent API base endpoints.
  • Add DC_SEARCH_SCOPE environment variable and configuration setting to control query search target scope.
  • Pass configured search scope in Agent API indicator search requests.
  • Wrap HTTP network request failures into 503 Agent API error exceptions.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces support for DC_AGENT_API_ROOT and DC_SEARCH_SCOPE configurations to the Data Commons MCP package, allowing more granular control over Agent API endpoints and search scopes. Key changes include updating AgentAPIClient to accept and pass the search scope, improving exception handling, and adding corresponding unit tests. Feedback recommends simplifying the initialization in app.py by avoiding dynamic attribute checks on the Pydantic settings model, and truncating the error body in AgentAPIError.str to prevent log flooding from large API responses.

Comment thread packages/datacommons-mcp/datacommons_mcp/app.py Outdated
Comment thread packages/datacommons-mcp/datacommons_mcp/exceptions.py
@keyurva
keyurva requested a review from clincoln8 July 24, 2026 07:29

@clincoln8 clincoln8 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Woop woop!

@keyurva
keyurva merged commit 1413ccc into datacommonsorg:main Jul 24, 2026
13 of 14 checks passed
@keyurva
keyurva deleted the dc-agent-api-root branch July 24, 2026 18:13
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.

2 participants