Add cds toolset: Copernicus Climate Data Store retrieval workflow#4
Merged
Conversation
ciaransweet
approved these changes
Jun 12, 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.
Ports the eight LangChain tools from the
cds-assistantrepo into this monorepo as a single toolset, deployed as one MCP service (mcp-cds).What's included
toolsets/cdscovers the full CDS retrieval workflow:search_datasets(catalogue keyword search),get_dataset_schema(required parameters, valid values, types),apply_constraints(valid values given a partial request, e.g. to verify recent dates exist in the archive)submit_request,get_job_status,get_results(download link for completed jobs),list_jobscheck_credentialsTools call the CDS retrieve/catalogue APIs via a shared
httpxclient with exponential-backoff retry on transient failures (tenacity), and return structured error dicts (auth,licence,queue_limit,not_found,not_ready,bad_request,transient) so an agent can react appropriately — e.g. the licence error includes the dataset page URL where terms must be accepted.Since the runtime only needs a
cds.toolsmodule exportingTOOLS, the original one-module-per-tool layout is preserved by makingtoolsa package.Changes from the source repo
CDS_API_KEYis optional at import time so the server starts (and the contract test passes) without credentials; calls return structured auth errors until the key is provided.TOOLSexport test.Configuration
CDS_API_KEYvia env or.env, thenTOOLSET=cds uv run mcp-serve.toolset.yamllists acds-credentialsSecret (injected viaenvFrom), to be created out-of-band:Testing
./scripts/test— 60 passed (20 new, plus the contract test now coverscds)./scripts/lint— ruff and mypy clean/healthlists all eight tools andmcp-cli listshows correct schemas over streamable HTTP