Skip to main content

Token saving

Updated on 3 November 2026.

Compress tool results before they reach the model, so agents use fewer tokens on each MCP call.

Token saving on the AI gatewaysExplainer1:58

How the LLM Gateway and MCP Gateway rewrite JSON, HTML, Markdown and verbose text into fewer tokens before it reaches the model.

YouTube All videos

Choose the instructions for the mode that governs your MCP Gateway. See Switching from classic settings for what happens to stored settings when the engine is on.

Going further with the Policy Engine​

Open Govern > Policy Engine > MCP Gateway > Controls > Token Savings. Published policies govern tool-result transforms while the engine is on; stored classic values are used when it is off.

SectionWhat it changes
Smart JSON compressionCompacts eligible JSON results.
HTML to textRemoves HTML markup.
Markdown to textRemoves Markdown formatting.
Text compressionShortens verbose plain text.
Strip base64 contentReplaces encoded content with a size note. That content is no longer available to the model.
  1. Choose a recipe for a transform or start a blank rule in its section.
  2. Choose Applies to: a server, tool, person, Smart Group, agent, or route.
  3. Set only the switches you want to change, check Reads as, and Save to draft.
  4. Test and publish the change.

Each switch resolves independently: highest numeric priority wins, with On winning ties. An Off exemption must outrank the matching On rule. With no rule, responses return as the server sends them.

Base64 stripping removes information rather than merely shortening its representation. Enable it only where the model does not need the encoded payload.

Open Activity to review observed activity for this control. OneMCP Features separately controls dynamic discovery and short tool lists.

Where savings show​

PlaceWhat you see
Server cardToken saving chip (Yes / No) and tokens saved for the period.
Overall analytics > OverviewResponse-token savings across servers in MCP Gateway Insights.
Costs & SavingsSavings from the MCP channel.

OneMCP saves tokens too​

OneMCP reduces the tokens agents use to discover tools. With dynamic tool calling on, an agent receives a small set of tools instead of every server's full tool list:

ToolPurpose
list_mcp_connectionsLists the MCP servers the person can use and whether each is connected.
find_relevant_toolsFinds the tools that fit the current task.
call_toolCalls the chosen tool.

Set it with the OneMCP endpoint button in the MCP Gateway header, under Dynamic tool calling (User preference, Always on or Always off).

To shorten the tool list itself, per server and on the server's own address too, see Tool lists: the server's most-used tools in full and every other tool one search away.