Skip to content

feat: add NASA PSI agent tools (psi_api_tool + metadata_expansion_tool) - #116

Open
maf404 wants to merge 1 commit into
NASA-IMPACT:developfrom
maf404:feat/psi-tools
Open

feat: add NASA PSI agent tools (psi_api_tool + metadata_expansion_tool)#116
maf404 wants to merge 1 commit into
NASA-IMPACT:developfrom
maf404:feat/psi-tools

Conversation

@maf404

@maf404 maf404 commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds two tools under akd_ext/tools/psi/ for NASA's Physical Sciences Informatics (PSI) data repository, following the BaseTool / @mcp_tool pattern. All PSI endpoints are public — no API key required.

  • psi_api_tool — one tool with an operation selector: discover_investigations, get_investigation, search_files, navigate_dataset, retrieve_file, and lookup_publication (DataCite).
  • metadata_expansion_tool — enriches, caches, and ranks investigation metadata for candidate selection.

This mirrors the reference psi-agent-tools design (one API tool + one metadata tool) rather than one tool per operation.

Notes

  • Async (httpx.AsyncClient); httpx is already a transitive dependency, so nothing new is added.
  • Errors raise typed exceptions (akd-ext idiom). Results are summarized by default; response_mode="raw"/"both" also returns the raw upstream JSON.
  • All endpoints and paths are config fields with env-var defaults, so both tools construct zero-arg.

Testing

uv run pytest -m "not integration" tests/tools/psi/   # 24 offline (httpx.MockTransport, no network)
uv run pytest -m integration tests/tools/psi/         # 7 live (PSI + DataCite)
uv run pre-commit run --all-files                     # ruff clean

Add two tools under akd_ext/tools/psi/ for NASA's Physical Sciences
Informatics (PSI) data repository, following the akd-ext BaseTool /
@mcp_tool pattern:

- psi_api_tool: one operation-multiplexed tool covering
  discover_investigations, get_investigation, search_files,
  navigate_dataset, retrieve_file, and lookup_publication (DataCite).
- metadata_expansion_tool: enriches, caches, and ranks investigation
  metadata for candidate selection.

All PSI endpoints are public (no auth). HTTP is async (httpx.AsyncClient),
errors raise typed exceptions, and results are summarized by default with
an opt-in response_mode for raw upstream JSON.

Tests: 24 offline unit tests (httpx.MockTransport, no network) and 7
integration tests against the live PSI + DataCite APIs.
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