GLM MCP

v1.3.0
io.github.djerok/glm-mcp Checked 3 days ago Published 4 months ago

GLM (Zhipu/Z.ai) as a ~10x cheaper file-editing subagent for AI coding agents.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

glm_agent Run GLM as a file-accessing agent

Run GLM as a real coding agent with its OWN file tools (read/write/edit/list/bash); it works your repo end-to-end on GLM tokens (~10x cheaper than Opus). Prefer this over doing repo work yourself; it also handles text-only subtasks (give it a task with no file edits). Pass task + absolute workdir. Returns a concise summary+stats (use dry_run to preview a diff first). Not for sensitive, huge-context, or heavy dependent-tool-loop work.

ParameterTypeDescription
task *stringThe coding task for GLM to carry out end-to-end in the repo.
contextstringOptional extra context/constraints (GLM can also read files itself).
dry_runbooleanIf true, GLM proposes a diff and writes nothing (preview before applying). Default false.
formatstringconcise (default: summary+stats+changed files) or detailed (adds full diff). dry_run always shows the diff.
max_tokens'auto' (default): uncapped/generous per turn — you (the orchestrating agent) decide. Pass a number (256–131072) to cap each turn. (GLM_CAP=on enforces a hard limit regardless.)
modelstringModel id or 'auto' (default, peak-aware).
thinkingbooleanEnable GLM reasoning mode for harder tasks. Default false.
workdirstringAbsolute path to the project root GLM should operate in. Defaults to the server's cwd; always pass it explicitly.

glm_recommend Recommend GLM vs Opus for a task

Free local advisory (no GLM call): given a task profile, returns GLM-vs-Opus, model, confidence, and reasons. Call when unsure which engine to use.

ParameterTypeDescription
chinesebooleanTrue if Chinese or Chinese-English bilingual (GLM strength, +1).
complexitystringDefault 'medium'.
input_tokensintegerApprox context size needed. >128K forces Opus (GLM degrades past ~100K).
latency_sensitivebooleanTrue if a tight interactive loop (forces Opus).
long_horizonbooleanTrue if many sequential steps / multi-hour autonomy.
needs_parallelbooleanTrue if it needs several concurrent agents (forces Opus).
sensitivebooleanTrue if proprietary/security-critical (forces Opus).
stepsintegerApprox number of dependent sequential steps. >20 forces Opus (goal drift).
task_typestringClosest task category. Default 'general'.
tool_patternstringTool-use shape: single one-shot call / short independent fanout (GLM-ok) vs heavy dependent agentic loop (forces Opus).
unfamiliar_apibooleanTrue if it uses a niche/post-cutoff/internal API GLM can't know (-2; paste docs or use Opus).
visionbooleanTrue if input includes images/screenshots/GUI/computer-use (forces Opus).

glm_status GLM status & config

Free local status: peak window, active model, GLM usage ledger (proof of GLM tokens spent), and config health. No GLM call.