Skip to content

Conversation

@gregnr
Copy link
Collaborator

@gregnr gregnr commented Nov 25, 2025

Minifies our content API's GraphQL schema before injecting it into the search_docs tool description. This strips out insignificant whitespace and removes comments, reducing the character size by 75% (actual token savings are model-dependant but should be similar, e.g. ~76% for GPT tokenizer).

This helps lower the amount of context that MCP clients need to load for their LLMs (translating to cost savings).

Are there downsides?

The main downside is stripping out comments, which usually benefit LLMs by giving them a richer description of how to use the API. I tested the minified version with Cursor and it successfully formed the GraphQL query with no errors:

image

I think the schema is pretty self-describing without the comments, so the benefit of removing the context is likely worth it.

@gregnr gregnr force-pushed the feat/minified-graphql-schema branch from abafcca to 735c48c Compare November 25, 2025 22:34
Copy link
Contributor

@mattrossman mattrossman left a comment

Choose a reason for hiding this comment

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

Tested in Cursor, drops Composer context usage a couple %

@gregnr gregnr merged commit 48e3ed1 into main Nov 26, 2025
3 checks passed
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.

4 participants