Skip to main content
Glama

offerhopper.ai — AI Supermarket & Drugstore Shopping Assistant for Germany

Swap an item on a shopping route

swap_route_item

Swaps one item's chosen offer on an existing shopping route (from a prior plan_optimal_shopping_route result) for one of its alternatives, then returns the RECOMPUTED route with corrected costs and the honest worth-it verdict. Use this to correct a poor pick (e.g. the engine matched a soup hen instead of a roasting chicken) or to take a cheaper/better option the agent spotted in the item's 'alternatives'. The alternative may be at the SAME store or at ANOTHER store ALREADY ON THE ROUTE — it must be the same item category, and its store must already be a stop (no new stores; for that, call plan_optimal_shopping_route again). Keys on stable offer ids: pass the current item's offer_id and the target alternative's offer_id (both taken verbatim from the prior response's products_to_buy / alternatives). The shared route (share_url) is updated in place so the interactive map reflects the swap.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
shareYesThe share_url (or its 8-char id) returned by plan_optimal_shopping_route
alt_idYesoffer_id of the alternative to swap in (from that item's 'alternatives')
offer_idYesoffer_id of the item currently on the route (from products_to_buy)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Added

TDQS

A5/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the annotations, the description reveals important behaviors: the route is recomputed with corrected costs, the shared route 'is updated in place so the interactive map reflects the swap,' and swaps key on stable offer IDs. It also clarifies constraints such as same item category and no new stores.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is detailed yet efficient; each sentence adds necessary information about purpose, use cases, constraints, IDs, or side effects. Core behavior is front-loaded, with supporting details arranged logically.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description fully equips an agent to invoke the tool correctly: it explains prerequisites, input provenance, constraints, side effects, and return value. Given the output schema and sibling signal, nothing essential is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, but the description adds significant semantic context: offer_id comes from products_to_buy, alt_id from the item's alternatives, and share is the share_url returned by plan_optimal_shopping_route. It even instructs to take IDs 'verbatim from the prior response,' reducing ambiguity.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb, resource, and outcome: 'Swaps one item's chosen offer on an existing shopping route ... for one of its alternatives, then returns the RECOMPUTED route.' It clearly distinguishes itself from plan_optimal_shopping_route by scoping to existing routes and prior results.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly says when to use it: 'correct a poor pick' or 'take a cheaper/better option' from alternatives. It also gives a clear exclusion: the alternative's store must already be a stop, and if a new store is needed, 'call plan_optimal_shopping_route again.'

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources