Skip to main content
Glama

optimize_code_by_spec

Optimizes existing code to comply with OpenSpec specifications, using provided spec and optional feedback for targeted improvements.

Instructions

根据OpenSpec规范优化现有代码

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes需要优化的代码
specYesOpenSpec规范内容
feedbackNo优化反馈和建议
Behavior2/5

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

No annotations are provided, and the description does not disclose any behavioral traits such as side effects, return values, or operational requirements (e.g., file I/O). The agent is left without understanding what happens after the optimization.

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?

The description is a single concise sentence that conveys the core purpose without unnecessary words. It is well-structured and efficiently communicates the tool's function.

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

Completeness2/5

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

Despite having no output schema and no annotations, the description fails to specify what the tool returns or any operational context. The agent lacks information needed to fully understand the tool's behavior in a workflow.

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?

All three parameters have descriptions in the schema (100% coverage), so the tool description adds minimal extra meaning. It reinforces the spec's role but does not provide deeper semantics beyond the schema.

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 tool optimizes existing code based on an OpenSpec specification. It distinguishes from sibling tools (create_openspec_project and generate_openspec_spec) by focusing on code optimization rather than project creation or spec generation.

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?

The description implies the tool is for optimizing code with a spec but does not explicitly state when to use it versus alternatives or provide any usage exclusions. The sibling names offer context but not direct guidance.

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/leon30083/trae-openspec-mcp'

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