Skip to main content
Glama
arikusi

Deepseek MCP Server

by arikusi

DeepSeek FIM Completion

deepseek_fim

Generate missing text between a prefix and an optional suffix using DeepSeek V4 Fill-in-the-Middle. Built for code completion and content infilling with cost tracking and model fallback.

Instructions

Fill-in-the-Middle (FIM) completion with DeepSeek V4. Provide a prompt (prefix) and an optional suffix; the model completes the text in between. Ideal for code completion and content infilling. Runs in non-thinking mode on the Beta endpoint; output is capped at 4K tokens. The deprecated aliases deepseek-chat and deepseek-reasoner are still accepted and resolve to deepseek-v4-flash (FIM has no thinking mode). Includes automatic cost tracking and model fallback with circuit breaker resilience.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stopNoOptional stop sequence(s). Generation stops when any is produced. A single string or an array of up to 16 strings.
modelNoModel to use. deepseek-v4-flash (default, fast/economical) or deepseek-v4-pro (most capable). Deprecated aliases deepseek-chat / deepseek-reasoner are still accepted and resolve to v4-flash. FIM is always non-thinking.deepseek-v4-flash
promptYesThe prefix text that comes before the content to generate. Required. For code completion, this is the code up to the cursor.
suffixNoOptional suffix text that comes after the content to generate. The model fills the gap between prompt and suffix.
max_tokensNoMaximum tokens to generate. FIM completions are capped at 4096 tokens by the API.
temperatureNoSampling temperature (0-2). Higher = more random. Default: 1.0.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYes
modelYes
usageYes
cost_usdNo
routed_fromNo
finish_reasonYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.3.0
    • changedInput schema / properties / model / description
      Previous value: -"Model to use. deepseek-v4-flash (default, fast/economical) or deepseek-v4-pro (most capable). Aliases deepseek-chat / deepseek-reasoner resolve to v4-flash. FIM is always non-thinking."New value: +"Model to use. deepseek-v4-flash (default, fast/economical) or deepseek-v4-pro (most capable). Deprecated aliases deepseek-chat / deepseek-reasoner are still accepted and resolve to v4-flash. FIM is always non-thinking."
  2. Addedv2.1.0

TDQS

A4/5.0
Behavior4/5

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

With no annotations provided, the description carries the full disclosure burden and does substantial work: it discloses the non-thinking mode, Beta endpoint, the 4K output cap, deprecated alias resolution to deepseek-v4-flash, and automatic cost tracking with fallback/circuit-breaker resilience. It only omits operational details like rate limits and error behavior, which are not typically required for invocation.

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?

Four sentences, front-loaded with purpose, with every sentence carving a distinct role: mechanism, use case, endpoint/mode/cap, then alias and resilience behavior. No filler words, and the critical scoping information comes first so an agent scanning the description immediately knows what the tool does.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given an output schema exists (return values need no explanation), only one required parameter, and 100% schema coverage, the description is nearly complete: it covers behavior (non-thinking, Beta, 4K cap), alias semantics, and resilience. The omission of rate limits and explicit sibling routing is minor for a single-call completion tool, but with no annotations the description could have gone slightly further.

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 the baseline is 3 and the schema already documents all 6 parameters, including the model enum and the 4096 cap. The description adds modest extra meaning by framing prompt+suffix as an infill gap ('the model completes the text in between') and by restating alias resolution, but most of its param-related content duplicates the model and max_tokens schema descriptions.

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 mechanism and resource: 'Fill-in-the-Middle (FIM) completion with DeepSeek V4', and explains the exact contract — 'Provide a prompt (prefix) and an optional suffix; the model completes the text in between.' This clearly separates it from the deepseek_chat and deepseek_sessions sibings, since FIM fill-in-the-midddle semantics are structurally different from conversation or session management.

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

Usage Guidelines3/5

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

It gives clear use-case context — 'Ideal for code completion and content infilling' — and notes FIM 'has no thinking mode', which implicitly discourages use for reasoning-heavy prompts. However, it never names the sibling tools or explicitly states when to choose deepseek_chat instead (e.g., multi-turn conversation, general Q&A), so the selection logic is left to inference.

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

Deploy Server

Other Tools