Skip to main content
Glama
Swih

Mistral MCP — Document Extraction

by Swih

Codestral fill-in-the-middle completion

codestral_fim
Read-only

Generate code between a given prefix and suffix for editor autocomplete, code patching, or structured refactors.

Instructions

Fill-in-the-middle code completion with Codestral.

Given prompt (code preceding the cursor) and suffix (code after the cursor), Codestral writes the middle. Use for editor autocomplete scenarios, code-patching agents, or structured refactors where you know the target boundaries.

Default stop tokens: [] — let the model decide. Override with stop if needed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
seedNoRandom seed for deterministic sampling. Maps to Mistral's `random_seed`.
stopNoStop generation when any of these text sequences is encountered.
modelNoFIM (fill-in-the-middle) model identifier. Any identifier your endpoint serves is accepted — read mistral://models for the live catalog. Known Mistral aliases: codestral-latest.
top_pNoNucleus sampling probability mass: 0.1 considers tokens in the top 10% of probability mass. Prefer adjusting this or temperature, not both.
promptYesCode preceding the cursor.
suffixYesCode after the cursor. Can be empty string.
max_tokensNoMaximum number of tokens to generate. Input tokens plus this limit must fit within the model's context length.
temperatureNoSampling temperature: higher values make output more random; lower values make it more focused. Prefer adjusting this or top_p, not both.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYes
modelYes
usageNo
finish_reasonNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed14 schema fields changedv0.8.3
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / max_tokens / description
      Added value: +"Maximum number of tokens to generate. Input tokens plus this limit must fit within the model's context length."
    • addedInput schema / properties / max_tokens / maximum
      Added value: +9007199254740991
    • addedInput schema / properties / model / description
      Added value: +"FIM (fill-in-the-middle) model identifier. Any identifier your endpoint serves is accepted — read mistral://models for the live catalog. Known Mistral aliases: codestral-latest."
    • removedInput schema / properties / model / enum
      Removed value: -[
      -  "codestral-latest"
      -]
    • addedInput schema / properties / model / maxLength
      Added value: +200
    • addedInput schema / properties / model / minLength
      Added value: +1
    • addedInput schema / properties / seed / maximum
      Added value: +9007199254740991
    • addedInput schema / properties / seed / minimum
      Added value: +-9007199254740991
    • addedInput schema / properties / stop / description
      Added value: +"Stop generation when any of these text sequences is encountered."
    • addedInput schema / properties / temperature / description
      Added value: +"Sampling temperature: higher values make output more random; lower values make it more focused. Prefer adjusting this or top_p, not both."
    • addedInput schema / properties / top_p / description
      Added value: +"Nucleus sampling probability mass: 0.1 considers tokens in the top 10% of probability mass. Prefer adjusting this or temperature, not both."
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  2. Changed1 schema field changedv0.7.0
    • addedInput schema / properties / seed
      Added value: +{
      +  "description": "Random seed for deterministic sampling. Maps to Mistral's `random_seed`.",
      +  "type": "integer"
      +}
  3. First observedv0.4.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, openWorldHint=true, idempotentHint=false, and destructiveHint=false. The description adds useful generation behavior by noting the default stop tokens are empty and that the model decides when to stop unless `stop` is overridden.

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?

Front-loaded with a one-line purpose, followed by cursor semantics, use cases, and stop-token behavior. Every sentence earns its place and no filler is present.

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?

Given rich annotations, 100% schema coverage, and an output schema, the description supplies the missing conceptual model: prompt before cursor, suffix after cursor, and Codestral writes the middle. It is complete enough for correct invocation without redundant return-value explanation.

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 prompt/suffix meanings are already documented. The description adds extra semantics for `stop`: default is [] and the model decides, with explicit override guidance, going beyond the schema's brief stop description.

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 a specific verb and resource: fill-in-the-middle code completion with Codestral, plus the prompt/suffix cursor model. The FIM and editor-autocomplete framing distinguishes it from sibling chat, vision, OCR, transcription, and document tools without needing schema inspection.

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?

Provides clear usage contexts: editor autocomplete, code-patching agents, and structured refactors where target boundaries are known. It does not explicitly name when to avoid this tool or route to a sibling like mistral_chat for general generation.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.