Skip to main content
Output response filtering lets xpander agents handle large skill responses without overflowing the context window. A skill might return a 50KB JSON response, which is mostly noise. You configure a per-skill output schema once in Xpander Chat, and xpander trims the response down to the fields you whitelist before it reaches your agent loop. In the SDK a skill is a Tool; the filtered result is what agent.ainvoke_tool returns.

Configure an output schema

1

Open the action's settings

Open your agent in Xpander Chat, open its settings with the gear icon, and expand the skill on the Skills row. In the skill’s actions list, open the group and click Advanced on the action you want to filter. Long action names are cut short in this list. In the example, R… is Retrieve News Articles by Topic.Agent settings with the Google News skill expanded: its connection, execution policy, approval switches and the News Retrieval action group, whose action Retrieve News Articles by Topic shows truncated as R...
2

Open the Output filter tab

The action’s panel has two tabs, Input schema and Output filter. On Output filter, Response keys lists the top-level keys of a sample response: tick the keys to keep, and untick one to drop it with everything nested under it. What the agent sees shows the trimmed response and its size.Output filter tab of the Retrieve News Articles by Topic action: Response keys with checkboxes, What the agent sees with the trimmed JSON, and Save output filterWrite the schema from a real captured response, not the API docs. Open the agent’s run history, expand a skill result to see the full JSON shape, and pick only the fields the agent actually needs to answer questions. Be aggressive. Leave a field out and add it back only if the agent fails without it.
3

Save and publish

Click Save output filter; it is saved as a draft until the agent is published, then applies to every invocation from that point on, whichever agent loop runs the agent.

Verify the filtered shape from code

Once a schema is published, invoke the skill directly and inspect what the LLM actually receives:
To confirm what was removed, briefly clear the schema on the skill’s Output schema tab (the edit icon next to the skill under the agent’s Skills row), capture the full response, then re-enable it. The diff is exactly what you’ve cut from the LLM’s context.

Troubleshooting

Output response filtering only applies to remote catalog skill calls, not local @register_tool functions. Whatever you return from a Python function reaches the LLM verbatim. To slim a local skill’s output, do it inside the function before returning.
The schema dropped a field the agent actually needed. Add it back and republish. Common case: stripping created_at because it seems unnecessary, then a user asks “when did we onboard them?” and the agent guesses.
Output schemas are allow-lists. If the upstream API adds a field, your schema silently drops it. When the vendor behind a skill announces an API update, re-check your schemas against a fresh captured response.
Either no schema is configured, the skill you filtered isn’t the one driving most tokens, or the response was already small. Use the run history to find which skill calls return the largest payloads and filter those first. List endpoints and search results are usually the biggest wins.

Next steps

Pre-built skills

The full reference for catalog skills, including the input-schema half of the Advanced tab.

Skill call hooks

Observe and log skill calls, including filtered responses, across the agent’s lifetime.

Custom skills

Add your own Python functions with @register_tool. Output filtering does not apply to local skills.

Knowledge bases

Indexed retrieval for grounding agents in your own corpus.