Skip to main content
Glama

Find (and optionally pay) the best service for a need

route_by_intent
Destructive

Given a plain-language description of what you need, find, and optionally pay in the same call, the single best payable catalog service, so you do not have to pick among listings yourself. Use it instead of search_services when you want the right service for a task rather than a list to browse: it ranks candidates on Nevermined's own relevance and quality signals (deterministic; no model reads the merchant listings), applies a fail-closed payability gate (listed, healthy, moderated, x402/mpp, not flagged unpayable) and a relevance floor, and returns the winner as chosen (with its opaque invoke handle, never a raw host) plus a ranked shortlist; every shortlist item carries a closed matchReason, gateReason, per-item rankingSource, and one scale-specific score. With autoPay:false (the default) it returns the pick only and charges nothing; the next step is normally get_service on chosen.slug, then pay_service with the endpoint you need. With autoPay:true it also pays the winner through the same path as pay_service and returns the upstream call in result: result.status and result.body are the vendor's answer, and result.paid: true means a payment was attempted, not that it settled, so read result.payment.status (Settled, Issued or Failed). autoPay calls the winner at its base URL plus any path you pass, and you only learn the winner from this call, so it suits single-endpoint services; a multi-endpoint winner typically answers 404 at its base URL. autoPay requires requestId; an API-key caller must also pass delegationId, while an OAuth-connected caller spends from the grant it approved and needs none. Outcomes: matches, but none could be chosen (or nothing matched while semantic ranking is down) → {"status":"no_fundable_match"} (broaden the intent or filters; nothing charged); payable matches that are all too weak to choose → the same status with reason: "below_relevance_floor", and no match at all → reason: "no_match" (for either, rephrase the intent to name the capability concretely or relax filters, or browse with search_services; nothing charged); the close match is unhealthy or held by moderation right now → the same status with reason: "relevant_candidate_unavailable" (retry later, or browse with search_services; nothing charged); close matches that all fail to return the media named in wantedMedia → the same status with reason: "media_mismatch" and wantedMedia as applied (browse with search_services, or pin a slug in filters.require; nothing charged); on autoPay, a close match sold for Nevermined credits only, with nothing else to choose → the same status with reason: "credits_only" and its slug (pay it with pay_service and no delegationId, from your credits; nothing charged); on autoPay while semantic ranking is unavailable → {"status":"autopay_unavailable"} (the Router will not pay a keyword-only pick: retry later with the same requestId, or call without autoPay and pay the pick with pay_service; nothing charged). Relevance compares what you wrote with how each listing describes itself; when you list the media you need back in wantedMedia (an image, audio or a video), it also chooses only a service it records as returning each of them (from some endpoint; audio beside video is not checked separately, and the Router does not verify that a returned video has sound), unless you pin one with filters.require. The Router never infers the media from the intent, so set wantedMedia whenever you need media back. It checks what the winner returns, not what it accepts, so a need that combines several steps can still get a pick that does only one: for such a need, select without autoPay and check the winner with get_service before you pay. Other outcomes: missing_autopay_fields (nothing charged); on autoPay, payment_indeterminate (check list_payments, and retry only with the same requestId) and already_paid (this requestId already carries a payment, see paymentId; nothing new billed, and it does not by itself say whether the original succeeded). Every pick and each of these outcomes carries an instructions string with the next step; a payment the Router declines on autoPay comes back as a tool error carrying the API's message. Requires your Nevermined API key on the Authorization header.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "intent": "<intent>"
    },
    "name": "route_by_intent"
  }
}

Input Schema

NameRequiredDescriptionDefault
bodyNoRequest body for the paid call (autoPay only).
pathNoSubpath appended to the winner when paying (autoPay only).
limitNoShortlist size to return (1–20, default 5).
intentYesPlain-language description of the service you need (e.g. "translate English to German").
methodNoHTTP method for the paid call (autoPay only).
searchNoQuery string (no leading ?) for the paid call (autoPay only).
autoPayNoWhen true, also pay and relay the winner in the same call (same path as pay_service); requires requestId, plus delegationId when you authenticate with an API key. Default false → return the pick only, no charge. A paid body too large or binary to inline comes back as `result.bodyOmitted`, as pay_service describes for `responseOmitted`.
filtersNoOptional structured narrowing; all fields optional.
headersNoExtra headers for the paid call (autoPay only).
requestIdNoIdempotency key — REQUIRED when autoPay is true.
wantedMediaNoThe media you need the chosen service to return. Set it whenever you need an image, audio or a video back, for example `["video"]` to dub a video or `["audio"]` for text to speech; leave it unset for text or data. When set, only a service recorded as returning each of them (from some endpoint) is chosen (a `filters.require` pin is exempt); `audio` beside `video` is not checked separately (the Router does not verify that a returned video has sound), and when no close match does, the result is `no_fundable_match` with `reason: "media_mismatch"` (the API's BCK.ROUTER.0053). The Router never infers it from `intent`.
delegationIdNoDelegation to charge on autoPay. Required when you authenticate with an API key; an OAuth-connected caller spends from the grant it approved, so it can omit this (a value there does not choose the delegation).
maxTotalCentsNoRefuse a paid quote above this (fee-inclusive), before purchase (autoPay only).
credentialHeaderNoHeader the Router should carry the minted payment credential in on the paid hop (autoPay only). Send it only when the winning service needs its own auth AND a payment credential (e.g. "Payment"). Ignored when autoPay is false.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / wantedMedia
      Added value: +{
      +  "description": "The media you need the chosen service to return. Set it whenever you need an image, audio or a video back, for example `[\"video\"]` to dub a video or `[\"audio\"]` for text to speech; leave it unset for text or data. When set, only a service recorded as returning each of them (from some endpoint) is chosen (a `filters.require` pin is exempt); `audio` beside `video` is not checked separately (the Router does not verify that a returned video has sound), and when no close match does, the result is `no_fundable_match` with `reason: \"media_mismatch\"` (the API's BCK.ROUTER.0053). The Router never infers it from `intent`.",
      +  "items": {
      +    "enum": [
      +      "image",
      +      "audio",
      +      "video"
      +    ],
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
  2. Changed3 schema fields changed
    • changedInput schema / properties / autoPay / description
      Previous value: -"When true, also pay and relay the winner in the same call (same path as pay_service); requires requestId, plus delegationId when you authenticate with an API key. Default false → return the pick only, no charge."New value: +"When true, also pay and relay the winner in the same call (same path as pay_service); requires requestId, plus delegationId when you authenticate with an API key. Default false → return the pick only, no charge. A paid body too large or binary to inline comes back as `result.bodyOmitted`, as pay_service describes for `responseOmitted`."
    • changedInput schema / properties / filters / properties / prefer / description
      Previous value: -"Prefer this exact opaque catalog slug when it is a payable match; otherwise keep the normal ranked fallback."New value: +"Prefer this exact opaque catalog slug when it is a payable match that reaches the relevance floor on its semantic score (a service not yet indexed for that score qualifies on a keyword match); otherwise keep the normal ranked fallback. Use `require` to select a slug the floor would refuse."
    • changedInput schema / properties / filters / properties / require / description
      Previous value: -"Require this exact opaque catalog slug. It is returned only if payable and healthy; otherwise the Router fails closed with BCK.ROUTER.0031 and never substitutes another service."New value: +"Require this exact opaque catalog slug. It is returned only if payable and healthy; otherwise the Router fails closed with BCK.ROUTER.0031 and never substitutes another service. The relevance floor does not apply to it."
  3. Changed4 schema fields changed
    • removedInput schema / additionalProperties
      Removed value: -false
    • removedInput schema / properties / filters / additionalProperties
      Removed value: -false
    • addedInput schema / properties / headers / propertyNames
      Added value: +{
      +  "type": "string"
      +}
    • addedInput schema / properties / maxTotalCents / maximum
      Added value: +9007199254740991
  4. Changed3 schema fields changed
    • addedInput schema / properties / filters / properties / exclude
      Added value: +{
      +  "description": "Never choose this exact opaque catalog slug.",
      +  "minLength": 1,
      +  "type": "string"
      +}
    • addedInput schema / properties / filters / properties / prefer
      Added value: +{
      +  "description": "Prefer this exact opaque catalog slug when it is a payable match; otherwise keep the normal ranked fallback.",
      +  "minLength": 1,
      +  "type": "string"
      +}
    • addedInput schema / properties / filters / properties / require
      Added value: +{
      +  "description": "Require this exact opaque catalog slug. It is returned only if payable and healthy; otherwise the Router fails closed with BCK.ROUTER.0031 and never substitutes another service.",
      +  "minLength": 1,
      +  "type": "string"
      +}
  5. First observed

TDQS

A4.2/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false, destructiveHint=true and openWorldHint=true, and the description is consistent with all three (it can spend money, so mutation/destructiveness is implied). It adds genuinely non-obvious behavior beyond the annotations: the fail-closed payability gate, relevance floor, that 'result.paid: true means a payment was attempted, not that it settled' so result.payment.status must be read, idempotency on requestId, and the API-key vs OAuth delegation split. With annotations already covering the safety profile, this is strong added context rather than the sole source of it.

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

Conciseness2/5

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

The purpose is front-loaded in the first sentence, but the body is a very long run-on block that re-documents parameter semantics already present in the schema (wantedMedia, delegationId, credentialHeader) and enumerates outcome statuses in dense prose. Substantial content could be cut or moved to structured fields without losing information an agent needs.

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?

With no output schema, the description carries the full burden of describing returns (chosen with opaque handle, shortlist with matchReason/gateReason/rankingSource, result.status/body/payment.status) and it does so, plus every failure outcome and the recommended next step. For a 14-parameter tool with nested filters and a destructive payment path, nothing material is left unspecified.

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 description coverage is 100%, so the baseline is 3; the description exceeds it by explaining cross-parameter interactions the schema cannot, such as autoPay requiring requestId plus delegationId for API-key callers, wantedMedia not being inferred from intent, and filters.require bypassing the relevance floor. Some of this is restated verbatim from the schema (wantedMedia, delegationId), which limits the added value.

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?

The opening sentence names a specific verb and resource ('find, and optionally pay ... the single best payable catalog service') from a plain-language intent, and explicitly contrasts itself with the sibling that returns a list ('use it instead of search_services'). An agent can distinguish route_by_intent from search_services and pay_service without opening any schema.

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?

It states the selecting condition against the alternative ('when you want the right service for a task rather than a list to browse'), gives the default flow (autoPay:false → get_service on chosen.slug → pay_service), and calls out when autoPay is unsuitable ('suits single-endpoint services; a multi-endpoint winner typically answers 404'). Exclusions and fallbacks are spelled out rather than inferred.

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