Skip to main content
Glama

Run a chat completion on Synap

synap_chat_completion

Send a conversation to a model on Synap, Linkrra's OpenAI-compatible inference API, and get the model's reply. Use this when you need text generated, code written or a question answered by one of the open models Synap serves. This is the only tool here that costs money: it bills prompt and completion tokens to the Synap API key supplied as the Authorization: Bearer header on the MCP connection. With no key it returns an error and nothing is spent; a key with no balance returns insufficient_credits. Call synap_estimate_cost first if the price matters. Returns the standard OpenAI chat.completion JSON (choices[0].message.content holds the reply, usage holds token counts). The call is not streamed and keeps no memory between calls — send the full message history each time.

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": {
      "model": "<model>",
      "messages": "<messages>"
    },
    "name": "synap_chat_completion"
  }
}

Input Schema

NameRequiredDescriptionDefault
modelYesModel id exactly as returned by synap_list_models, e.g. "qwen3-coder-30b". Use "synap-v1" to let Synap pick the cheapest model that can handle the request.
messagesYesThe conversation so far, oldest first. The last message is normally the user turn to answer.
max_tokensNoUpper limit on tokens generated in the reply. Omit to use the model default; lower it to cap cost.
temperatureNoSampling randomness, 0 to 2. Lower is more deterministic. Omit to use the model default.

Output Schema

NameRequiredDescriptionDefault
idNo
modelNo
usageNo
objectNo
choicesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "choices": {
      +      "items": {
      +        "properties": {
      +          "finish_reason": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "index": {
      +            "type": "integer"
      +          },
      +          "message": {
      +            "properties": {
      +              "content": {
      +                "type": [
      +                  "string",
      +                  "null"
      +                ]
      +              },
      +              "role": {
      +                "type": "string"
      +              }
      +            },
      +            "type": "object"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "id": {
      +      "type": "string"
      +    },
      +    "model": {
      +      "type": "string"
      +    },
      +    "object": {
      +      "type": "string"
      +    },
      +    "usage": {
      +      "properties": {
      +        "completion_tokens": {
      +          "type": "integer"
      +        },
      +        "prompt_tokens": {
      +          "type": "integer"
      +        },
      +        "total_tokens": {
      +          "type": "integer"
      +        }
      +      },
      +      "type": "object"
      +    }
      +  },
      +  "required": [
      +    "choices"
      +  ],
      +  "type": "object"
      +}
  2. Changed1 schema field changed
    • changedInput schema / properties / model / description
      Previous value: -"Model id exactly as returned by synap_list_models, e.g. \"qwen/qwen3-coder-30b-a3b-instruct\". Use \"synap-v1\" to let Synap pick the cheapest model that can handle the request."New value: +"Model id exactly as returned by synap_list_models, e.g. \"qwen3-coder-30b\". Use \"synap-v1\" to let Synap pick the cheapest model that can handle the request."
  3. Changed10 schema fields changed
    • addedInput schema / properties / max_tokens / description
      Added value: +"Upper limit on tokens generated in the reply. Omit to use the model default; lower it to cap cost."
    • addedInput schema / properties / max_tokens / minimum
      Added value: +1
    • addedInput schema / properties / messages / description
      Added value: +"The conversation so far, oldest first. The last message is normally the user turn to answer."
    • addedInput schema / properties / messages / items / properties / content / description
      Added value: +"The message text."
    • addedInput schema / properties / messages / items / properties / role / description
      Added value: +"Who wrote the message: system (instructions), user, or assistant (an earlier model reply)."
    • addedInput schema / properties / messages / minItems
      Added value: +1
    • changedInput schema / properties / model / description
      Previous value: -"Model id — see synap_list_models for the catalogue."New value: +"Model id exactly as returned by synap_list_models, e.g. \"qwen/qwen3-coder-30b-a3b-instruct\". Use \"synap-v1\" to let Synap pick the cheapest model that can handle the request."
    • addedInput schema / properties / temperature / description
      Added value: +"Sampling randomness, 0 to 2. Lower is more deterministic. Omit to use the model default."
    • addedInput schema / properties / temperature / maximum
      Added value: +2
    • addedInput schema / properties / temperature / minimum
      Added value: +0
  4. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Annotations only give the generic write/open-world/idempotency profile; the description adds material facts the agent could not infer: this is the only tool that bills money, billing goes to the bearer-token API key, and there are two named failure modes (no key → error with nothing spent, empty balance → insufficient_credits). It also discloses no streaming and no memory between calls, which directly affects how callers must resend history.

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?

Five sentences, front-loaded with purpose, then cost, then error behavior, then return shape and statelessness. Nothing is repeated from the schema, and each sentence carries an operational consequence.

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, yet the description still points at the exact reply path (choices[0].message.content) and usage counts, and it covers cost, auth, and statelessness. For a billable, non-idempotent inference call, nothing an agent needs in order to call it correctly is missing.

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

Parameters3/5

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

Schema description coverage is 100%, so all four parameters are already documented including the 'synap-v1' auto-select shortcut and token/temperature defaults. The description's main addition is 'send the full message history each time', which clarifies how to populate messages, but that is a modest increment over an already complete schema.

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 description opens with a specific verb and resource — 'Send a conversation to a model on Synap ... and get the model's reply' — and names the platform (an OpenAI-compatible inference API) so the agent knows the wire format. Siblings (list_models, get_model, estimate_cost) are clearly distinct from actually running an inference.

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

Usage Guidelines4/5

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

It gives a concrete use condition ('when you need text generated, code written or a question answered') and routes the agent to synap_estimate_cost when price matters, plus implicitly to synap_list_models for model ids. There is no explicit when-not clause, but the guidance is clear enough to act on.

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.