← All recipesAgents and tools / PYTHON

Tool selection without arbitrary execution

Turn a request into an allowed read operation. Both the tool name and its argument must belong to a predefined list.

Up to 1 API requestsInputs: fictional, EnglishExternal actions: 0
01 / WORKFLOW

What the model decides. What code checks.

  1. One request identifies the allowed action, exact order ID, and whether the user wants to change data.
  2. Code checks both confidence thresholds, the known ID list, and the absence of an order-change request.
  3. The only allowed tool reads a fictional local dictionary. No URLs, arbitrary code, or external actions are executed.
02 / LOCAL EXECUTION

Read. Run. Replay.

Unpack the archive and open its directory in a terminal. The first step needs neither a key nor a network connection.

1 · offline plan · 0 API requests
python3 runner.py tool-routing

For a real run, set SHVYDKO_API_KEY in your computer or server environment. Do not put the key in your browser or source code. Current account quotas and pricing apply.

2 · explicit live run
python3 runner.py tool-routing --live --output tool-routing-run.json

The report contains requests, actual responses, elapsed times, and known usage. The file is created with private permissions and never overwrites an existing file. Network failures are not automatically retried: check Usage before another call.

3 · replay saved responses · 0 API requests
python3 runner.py tool-routing --replay tool-routing-run.json

Replay checks that the recipe, inputs, and requests match. A local file is editable, so it is not signed proof of where responses came from. If you replace the inputs with your own data, the report will contain those data too: keep it private.

03 / REQUEST PLAN

An open contract, with every step visible.

The plan below was generated by the same runner from the bundled fixtures. It contains requests and author expectations, not model results.

offline-plan.json
{
  "mode": "offline_plan",
  "model_calls": 0,
  "recipe": "tool-routing",
  "author_expectation": {
    "tool": "lookup_order",
    "order_id": "DEMO-104"
  },
  "notice": "Requests only, no model answers. Hierarchy includes conditional branches; repetition requests are templates.",
  "requests": [
    {
      "state": {
        "message": "Please show the delivery status of order DEMO-104. Do not change it.",
        "known_orders": [
          "DEMO-104",
          "DEMO-205"
        ]
      },
      "questions": {
        "tool": {
          "type": "choice",
          "instructions": "Which read-only action is requested?",
          "criteria": {
            "lookup_order": "Read delivery status of one existing order",
            "none": "Not a supported read-only lookup"
          }
        },
        "order": {
          "type": "choice",
          "instructions": "Which exact known order is requested?",
          "criteria": {
            "DEMO-104": "DEMO-104",
            "DEMO-205": "DEMO-205",
            "unknown": "No unambiguous known order"
          }
        },
        "changes": {
          "type": "noul",
          "instructions": "The request asks to change, cancel, refund or otherwise mutate an order."
        }
      }
    }
  ]
}