Skip to main content
Glama

fim_completions

Read-only

Code fill-in-the-middle (Mistral FIM-compatible) — Drop-in for Mistral's Codestral FIM endpoint (POST /v1/fim/completions): send {model, prompt, suffix?, max_tokens?, temperature?, stop?} where prompt is the code before the cursor and suffix the code after; returns the missing middle as choices[0].message.content in the chat.completion shape with usage. Fences and repeated prefix/suffix are stripped. Served by Llama 3.3 70B, non-streaming; pay per call with x402, no API key. Price: $0.008 USDC (Base, via x402).

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>",
      "prompt": "<prompt>"
    },
    "name": "fim_completions"
  }
}

Input Schema

NameRequiredDescriptionDefault
modelYescodestral-latest
promptYesdef is_palindrome(s: str) -> bool:

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the readOnly/openWorld/non-destructive annotations: it discloses the backing model (Llama 3.3 70B), non-streaming operation, that output is post-processed to strip fences and repeated prefix/suffix, the response envelope shape, and the commercial terms (x402 pay-per-call, no API key, $0.008 USDC on Base). Those are exactly the behavioral facts an agent needs before spending money.

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?

Single dense paragraph with the purpose and invocation shape front-loaded and no filler sentences; every clause (model, stripping behavior, pricing) adds information. It is long, but the length is justified by the amount of decision-relevant detail.

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 and only two annotated-adjacent parameters, the description covers everything needed: what goes in, what comes out (choices[0].message.content in chat.completion shape with usage), cost, and streaming limitations.

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%, but the schema entries are only literal examples ('codestral-latest', 'def is_palindrome...'), so the description carries real semantic weight by explaining that prompt is the pre-cursor code and suffix the post-cursor code. It also mentions optional max_tokens/temperature/stop, which the schema does not declare — useful but a mild inconsistency an agent may trip over.

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 the specific operation ('code fill-in-the-middle'), names its compatibility target (Mistral/Codestral FIM, POST /v1/fim/completions), and shows the exact request shape, so an agent can distinguish it from generic completions/chat_completions siblings without opening the schema.

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?

The description defines precisely when this tool applies — prompt is the code before the cursor, suffix is the code after, and the model fills the gap — which is clear usage context. It does not explicitly exclude or point to alternatives for non-middle-fill generation, so it stops short of a 5.

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