Skip to main content
Glama

kimi_analyze

Analyze codebases by sending prompts to Kimi, which reads up to 256K tokens and returns structured reports with caching and configurable detail levels.

Instructions

Send a prompt to Kimi Code for codebase analysis. Kimi reads the codebase (256K context) and returns a compressed, structured report.

CACHE BEHAVIOR: If session_id is not provided, the MCP server will automatically use cached sessions when available.

  • First call: Creates cache (may take 60-120s for large codebases)

  • Subsequent calls: Reuses cached session (faster, ~10s)

  • Cache auto-expires after 30 minutes or when files change

  • Use kimi_cache_status to view cache statistics

Output is budget-controlled: Kimi reads 200K+ tokens of source but returns a 5-15K token analysis (configurable via detail_level). Use kimi_resume to drill deeper into specific areas. Takes 1-5 minutes for large codebases.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelNoModel id/alias. Default: k3 (K3). Examples: k3, kimi-code/k3, kimi-for-coding. Env override: KIMICODE_MODEL or KIMI_MODEL.
promptYesThe analysis prompt for Kimi (be specific about what to analyze)
thinkingNoEnable thinking mode for deeper analysis (default: true)
work_dirYesAbsolute path to the codebase root directory
use_cacheNoEnable automatic session caching (default: true). Set to false to bypass cache and create fresh session.
session_idNoResume a specific Kimi session by ID (from kimi_list_sessions). If not provided, cached session will be used when available.
detail_levelNoOutput verbosity. summary: ~2-5K tokens (file index + key findings). normal (default): ~5-15K tokens (structured analysis). detailed: ~15-40K tokens (with code snippets).
include_thinkingNoInclude Kimi internal reasoning in output. Default: false (saves 10-30K tokens). Enable only for debugging.
max_output_tokensNoMax tokens in response (~4 chars/token). Default: 15000. Use 3000-5000 for quick scans, 30000+ for detailed analysis.
Behavior5/5

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

No annotations provided, so description carries full burden. Details caching, time expectations (60-120s first, ~10s subsequent), auto-expiry, budget-controlled output (5-15K tokens), and configurable detail_level. Thoroughly transparent.

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?

Well-structured with clear sections (purpose, cache behavior, output). Front-loaded with main purpose. Somewhat lengthy but each part earns its place. Minor redundancy could be trimmed.

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?

Covers caching, timings, output budgets, relationships to sibling tools, and configuration options. No output schema needed; mentions structured report but not exact format. Fairly complete for a complex tool.

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

Parameters5/5

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

Schema coverage is 100%, baseline 3. Description adds significant value: explains caching mechanism in relation to session_id, detail_level token ranges, max_output_tokens usage, and distinction between thinking and include_thinking. Compensates well.

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?

Clearly states it sends a prompt to Kimi Code for codebase analysis, mentions reading codebase with 256K context and returning a compressed structured report. Differentiates from siblings by referencing kimi_resume and kimi_cache_status.

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 usage context: first call may be slow, subsequent calls faster via caching; suggests kimi_resume for deeper analysis. Lacks explicit when-not-to-use but covers key scenarios.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/howardpen9/kimi-code-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server