Skip to content

MCP search_schemas tool - #313

Merged
alexbainter merged 6 commits into
mainfrom
alex-293-search-schemas-tool
Jul 27, 2026
Merged

MCP search_schemas tool#313
alexbainter merged 6 commits into
mainfrom
alex-293-search-schemas-tool

Conversation

@alexbainter

Copy link
Copy Markdown
Collaborator

Closes #293. Closes #292.

Replaces the half-baked list_schemas tool with search_schemas.

search_schemas accepts a few parameters:

  • query: A string, which can be keywords (eg 'photos') or an $id value from a JSON schema. Can be omitted (None or blank) to just return everything in scope.
  • scope: Either 'all' or 'user', to control whether the results include everything accessible to the user (public + the user's own schemas) or just the user's, respectively. Defaults to 'all'.
  • page: A page number for paginated results. Defaults to 1.

Results are paginated (as per https://www.anthropic.com/engineering/writing-tools-for-agents) and limited to 10 results per page for now.

I got rid of PublicSchemaManager in favor of just adding a public() filter onto the new SchemaQuerySet, which meant I needed to update a few references. Similarly I added accessible_to(user) to that queryset which is a helper for "this user's private schemas + all public schemas" since we require that access pattern in a couple places.

@alexbainter
alexbainter force-pushed the alex-293-search-schemas-tool branch from 178643d to 9c4c469 Compare July 27, 2026 16:48
@alexbainter
alexbainter requested review from aaronjae22 and lisad and removed request for lisad July 27, 2026 16:52

@aaronjae22 aaronjae22 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Great!

@alexbainter
alexbainter merged commit b73366e into main Jul 27, 2026
11 checks passed
@alexbainter
alexbainter deleted the alex-293-search-schemas-tool branch July 27, 2026 19:34
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.

Replace list_schemas MCP tool with search_schemas Paginate MCP list_schemas/search_schemas tool results

2 participants