SEAB-7771 Page get_tool's versions through TRS /versions - #14
Conversation
get_tool now fetches the tool with includeVersions=false and one page of
/tools/{id}/versions at the same time, returning up to version_limit
versions (default 100) and the next page's offset, read from Dockstore's
next_page header. A page can be short or empty before the last one, so
models are told to keep going until next_version_offset is unset. A
Dockstore without SEAB-7771 sends no paging headers, and get_tool now fails
there rather than returning every version.
get_tool_version also returns the version's own description, which
Dockstore only fills in for a single version.
list_tools now caps limit at 100, the most Dockstore's /tools serves in a
page. Above that, its total and next_offset came out wrong.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| | ----------------------------- | ----------- | ------------------------------------------------------------------------------------ | | ||
| | `get_trs_info` | ✅ | Reports instance and version; unless `local_only`, also TRS info and tool classes. | | ||
| | `list_tools` | ✅ | Lists one page of TRS tools, optionally filtered by name, class, language, etc. | | ||
| | `get_tool` | ✅ | Retrieves one TRS tool by id, with all of its versions in full or summarized. | |
There was a problem hiding this comment.
Pretty much the bottom line here, a little faster here by default
ToolPage becomes PageOfTools, and ToolDetail becomes ToolWithPageOfVersions. ToolPage read like a kind of tool rather than a page of them, and ToolDetail read like the full form of ToolSummary, though the two come from different tools and a ToolDetail's versions can themselves be summaries. The private get_tool_page helper becomes get_page_of_tools to match. No tool's output fields change, only the titles in its output schema. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This comment was generated by Claude (Claude Code). Replaying the #12 evaluation prompts against this branch and The prompts are the ones from #12 (comment). All of them work with this branch. The only error in any run is Both versions ran in-process against a local webservice with SEAB-7771 (dockstore/dockstore#6374) and a production copy of the data: 5 alternating runs each, after a warm-up. Times are medians and include Dockstore but not MCP transport. Sizes are the text the agent receives. RB = Prompts A–G, as recorded
Prompt D when every version is needed With this branch, getting all 1,439 versions takes several
The extra bytes come from repeating the tool's metadata, including its 2.2 KB README, in every call's response. In a real session each call is also a separate model turn, which these times don't include, so the 15-call routes cost more than the table shows. What this means
|
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
| from dockstore_mcp.config import Settings | ||
| from dockstore_mcp.models import ( | ||
| FileWrapper, | ||
| PageOfTools, |
There was a problem hiding this comment.
Renamed ToolPage to PageOfTools to parallel ToolWithPageOfVersions and emphasize that a ToolPage is not a type of Tool.
| ``next_version_offset`` as ``version_offset`` (a page number, not an item index). | ||
| Keep going until it is unset: a page can come back short, or even empty, before the last. | ||
|
|
||
| Paging only speeds up the response for workflows, where Dockstore pages in the database, |
There was a problem hiding this comment.
Example of how to hint to the agent what MCP tools may be better than others in certain situations
Description
See what an MCP with a modified TRS dockstore/tool-registry-service-schemas#24 with pagination would function like. Some modest improvements.
Generated description:
Dockstore's TRS API now pages a tool's versions (SEAB-7771, dockstore/dockstore#6374), so
get_toolfetches the tool withincludeVersions=falseand one page of/tools/{id}/versionsin parallel. It returns up toversion_limitversions (default 100) plusnext_version_offset, which it reads from thenext_pageheader. Against a local webservice with SEAB-7771 and a production data copy, ReblockGVCF's first page takes 0.16 s and 56 KB, down from 0.62 s and 749 KB for all 1,439 versions. Going through every version takes 15 calls at the default page size, or 2 calls withsummaryandversion_limit=1000. A Dockstore without SEAB-7771 gets a clear error rather than every version.get_tool_versionnow also returns the version's owndescription, which only the single-version endpoint fills in.list_toolscapslimitat 100, the most/toolsserves per page: with a larger limit itstotalcame out wrong, 70,027 instead of 7,027.Review Instructions
After the linked PR is merged, https://github.com/dockstore/dockstore/pull/6374/changes#r4138373882 it will be possible to run the prompts in #12 (comment) and see a modest improvement in response size.
Not a huge difference, but an ok exercise to see how updating TRS for new parameters might look.
Issue
https://ucsc-cgl.atlassian.net/browse/SEAB-7771
Security and Privacy
None
e.g. Does this change...
Please make sure that you've checked the following before submitting your pull request. Thanks!
make check🤖 Generated with Claude Code