Ratel Docs
FeaturesAPIs

Tool Picker

Send what the agent wants to do. Get back the tools to call from your own catalog, ranked and scored.

POST https://cloud.ratel.sh/v1/tools/pick answers which of your project's tools an agent should call for a query.

You send only the query. Tool Picker reads the catalog your SDK already syncs to the Platform, so there is nothing to upload.

APIs, Tool Picker: picks, failed and last pick, and the three modes with their speed and use

Pick a tool

curl -s https://cloud.ratel.sh/v1/tools/pick \
  -H "Authorization: Bearer $RATEL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "leave a progress note on the task", "mode": "precise", "top_k": 3}'
const res = await fetch("https://cloud.ratel.sh/v1/tools/pick", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.RATEL_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ query: "leave a progress note on the task", top_k: 3 }),
});
const { tools, confident } = await res.json();
import os, requests

res = requests.post(
    "https://cloud.ratel.sh/v1/tools/pick",
    headers={"Authorization": f"Bearer {os.environ['RATEL_API_KEY']}"},
    json={"query": "leave a progress note on the task", "top_k": 3},
)
best = res.json()["tools"][0]
{
  "mode": "precise",
  "tools": [
    {
      "id": "add_task_comment",
      "name": "add_task_comment",
      "description": "Comment on a task.",
      "score": 0.94
    },
    {
      "id": "update_task",
      "name": "update_task",
      "description": "Update a task.",
      "score": 0.04
    }
  ],
  "confident": true,
  "usage": { "candidates": 99, "questions": 1, "input_tokens": 9580 }
}

Modes

ModeHow it decidesSpeedCredit
instantKeyword relevance against each tool's searchable descriptionA few msFree
precise (default)A decision model reads your catalog and scores every toolAbout 300 msUses credit
exhaustiveThe decision model reads every tool, in rounds, at any catalog size1 to a few sUses credit

The console names them Instant, Precise and Exhaustive.

  • Precise reads the whole catalog up to about 150 tools. Above that it reads the 25 most relevant.
  • Exhaustive reads every tool, up to 2,000. On a catalog that fits one read, it is the same as Precise.
  • Instant has no model in the loop. Use it for high-volume routing or a first pass.

On a real 99-tool production catalog, Precise matched the reference answer for 93.5% of queries, and had it in the top 5 for 98.4%.

Request

  • query (required): what the agent wants to do, up to 2,000 characters.
  • mode: instant, precise (default), or exhaustive.
  • top_k: how many tools to return, 1 to 20 (default 5).

Response

  • tools: best first. Each has the agent-facing description and a score.
  • score: for Precise and Exhaustive, the model's probability that this is the tool to call next. For Instant, keyword relevance where the best match is 1.
  • confident: true when the top pick clears the confidence bar calibrated against expert judges. Below it, treat tools as a shortlist. null for Instant.
  • usage: tools considered, model questions asked, and input tokens read.

An empty tools list means nothing in the catalog matched.

Credit

Precise and Exhaustive spend Tool Picker credit, by the tokens the model reads. A larger catalog reads more tokens. Instant is free and never touches a balance.

Rate limits

Limits are per project, per minute.

PlanInstantPrecise and Exhaustive
Hobby6010
Plus, Pro, Enterprise1,200300

A 429 carries Retry-After in seconds.

Errors

Errors use the same envelope as Embeddings.

StatusMeaning
400Bad body: missing query, unknown mode, or top_k out of range.
401Missing, invalid, or revoked API key.
402Out of Tool Picker credit. Top up, or use instant.
409The project has no synced tools. Sync your catalog with the Ratel SDK first.
429Rate limit reached. Wait Retry-After seconds.
502 / 503Temporarily unavailable. Retry, or fall back to instant.
504The pick took over 45 s. Retry, or use precise on a large catalog.

Earlier endpoint

POST /v1/pick is deprecated. It still works with its original request and response shape, and answers with a Deprecation header. Move to /v1/tools/pick.

Usage per project is on APIs › Tool Picker in the console: Picks, Failed and Last pick, per mode.

On this page