Skip to main content
Glama

draft_code_patch

Generate a minimal unified diff for a low-risk code change using a Chinese LLM. Review and test the patch before applying.

Instructions

Ask a Chinese LLM provider to draft a minimal unified diff for a small code task. Use this only for low-risk changes, then inspect and test the patch before applying it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
taskYesThe code change to draft.
filesYesRelevant file paths and contents. Keep this list small.
max_tokensNo
constraintsNoExtra implementation constraints.
temperatureNo
Behavior3/5

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

With no annotations, the description must cover behavioral traits. It mentions the tool drafts a diff (not applying it) and involves a Chinese LLM provider. However, it omits details like authentication, rate limits, whether it modifies state, or what happens on error. The caution to inspect before applying is useful but not exhaustive.

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?

Two sentences with no redundancy. The action, scope, and caution are front-loaded. Every word adds value.

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

Completeness3/5

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

The tool has 5 parameters and no output schema. The description explains the purpose and usage constraints but fails to describe the return value (the diff). Given complexity, it covers most aspects but the missing output specification lowers completeness.

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 coverage is 60%. The description adds value for 'task' and 'files' (e.g., 'Keep this list small'), but 'max_tokens' and 'temperature' lack descriptions in both schema and description. The description does increase clarity for half the parameters, but the gap for the other two prevents a higher score.

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 clearly states the action ('Ask a Chinese LLM provider to draft a minimal unified diff') and the resource ('small code task'). It distinguishes from the sibling tool 'run_cn_model' by specifying a focused use case (code patch drafting) rather than general model execution.

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 explicitly advises using this tool 'only for low-risk changes' and instructs to 'inspect and test the patch before applying it.' It provides clear context but does not enumerate alternatives or explicitly state when not to use it beyond the risk qualifier.

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/ZhuoS62/cn-llm-mcp'

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