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

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • addedOutput schema / additionalProperties
      Added value: +true
    • removedOutput schema / properties
      Removed value: -{
      -  "result": {
      -    "type": "string"
      -  }
      -}
    • removedOutput schema / required
      Removed value: -[
      -  "result"
      -]
    • removedOutput schema / x-fastmcp-wrap-result
      Removed value: -true
  2. Added

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnlyHint=false, destructiveHint=false, idempotentHint=false, openWorldHint=true). The description adds genuinely new behavior: the shared route (share_url) is updated in place so the interactive map reflects the swap, and the return is a full recomputation. It does not discuss failure modes (e.g. invalid/cross-category offer ids), so not a 5.

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

Conciseness4/5

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

Front-loaded with the core action and return, then constraints and keying; every sentence carries information. It is dense and parenthetical-heavy, but no sentence is disposable.

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?

An output schema exists, so return structure needn't be explained, and the description still adds the constraint set (same category, existing stop only, stable offer ids) and the in-place mutation side effect. Nothing needed to invoke it correctly is missing.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds provenance the schema lacks: offer_id comes verbatim from products_to_buy, alt_id from the item's 'alternatives', and share accepts a share_url or its 8-char id. The category and same-route-store constraints on alt_id are also stated only in prose.

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 (swap) and resource (one item's chosen offer on an existing shopping route), and scopes it to what gets returned (the recomputed route with corrected costs and verdict). An agent can distinguish this from plan_optimal_shopping_route, which builds routes rather than editing them.

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?

Gives explicit when-to-use triggers (correct a poor pick, take a cheaper/better spotted alternative) and an explicit when-not with the correct alternative tool ('no new stores; for that, call plan_optimal_shopping_route again'). Nothing is left to inference.

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