Skip to main content
Glama
Unified MCP Server

Unified MCP Server

by qingyunyupan

code_analyze

Analyze Python or JavaScript code to detect structural complexity, quality issues, and improvement opportunities; generate focused reports on performance, readability, security, or best practices.

Instructions

分析Python或JavaScript代码的结构、复杂度、质量问题和潜在改进点。提供详细的代码分析报告,包括性能、可读性、最佳实践等方面的评估。

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "code": "<code>",
      "language": "<language>"
    },
    "name": "code_analyze"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYes要分析的代码内容
focusNo分析重点(可选)
languageYes代码语言

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.2/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full burden. It does disclose the shape of the output (a report covering performance, readability, and best practices), which is valuable given there is no output schema, but it says nothing about whether code is executed, stored, or sent anywhere, nor about limits on input size.

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?

Two sentences, front-loaded with the verb and supported languages, with no filler. The second sentence partially restates the first ('detailed code analysis report' mirrors 'analyze'), costing a little tightness.

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?

For a simple three-parameter tool with full schema coverage, the description covers what is analyzed and roughly what comes back. It falls short on routing versus sibling analysis tools and on any behavioral constraints, which matter because no annotations exist to fill those gaps.

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 100%, so all three parameters and both enums are already documented structurally. The description loosely echoes the focus areas (performance, readability, best practices) but omits 'security' from the enum and adds no format or sizing guidance for the code parameter, so it stays at baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb (analyze) with a well-scoped resource (Python or JavaScript code) and enumerates what it examines: structure, complexity, quality issues, and improvement points. It does not differentiate itself from closely named siblings such as code_review, code_improve, or code_debug, which an agent could easily confuse with this tool.

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

Usage Guidelines2/5

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

There is no when-to-use guidance, no exclusions, and no mention of alternatives like code_review or code_improve. The agent must infer from the name alone when this broad analysis tool is preferable to a focused review or fix tool.

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