Skip to main content
Glama

analyze_code

Analyze code for security issues, errors, deceptive patterns, and placeholders. Returns a structured analysis with issues and strengths.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesThe source code to analyze
filenameYesThe filename (used to detect language). Example: 'app.ts'

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observed

TDQS

A3.5/5.0
Behavior2/5

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

With no annotations, the description bears full responsibility for behavioral disclosure. It states that the tool returns a structured analysis with issues and strengths, but it does not explicitly say whether the tool executes the code or performs static analysis only. Given sibling tools like execute_code and execute_code_with_variables exist, the lack of clarity about execution semantics is a meaningful gap.

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 two sentences, well-organized, and front-loaded with the primary action. Every sentence contributes meaning: the first states the scope, the second describes the return format. Zero fluff or redundancy.

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 appears to be a comprehensive analysis tool with 2 simple parameters and full schema coverage, so the description is moderately adequate. It mentions the return type ('structured analysis with issues and strengths') but gives no detail about the output structure, which could be important without an output schema. It also does not clarify how it differs from the many sibling analysis tools, leaving some contextual ambiguity.

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?

The input schema already provides full description coverage for both parameters (code and filename), so the baseline is 3. The description does not add any extra context about the parameters (e.g., language detection via filename), but no compensation is needed since the schema is complete.

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 uses a specific verb ('Analyze') with a clear resource ('code') and explicitly lists the issue categories (security, errors, deceptive patterns, placeholders). This distinguishes it from sibling tools like check_security or check_placeholders, which focus on individual categories, making the purpose unambiguous.

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 a comprehensive analysis covering multiple categories, which hints at when to use this tool over specialized siblings. However, it does not explicitly state 'use this for a full review' or mention when to prefer check_security, validate_code, etc. Usage context is implied rather than explicitly guided.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

TDQS

C2.4/5.0
Disambiguation2/5

Several tools have overlapping or ambiguous purposes that could confuse an agent. For example, analyze_code, analyze_patterns, and analyze_design_patterns all involve code analysis with unclear boundaries, while check_deceptive_patterns and check_placeholders seem like subsets of analyze_code. The NPM tools form a coherent group but are distinct from the rest, creating a fragmented toolset.

Naming Consistency2/5

Naming conventions are highly inconsistent across the toolset. Some tools use snake_case (e.g., analyze_code, execute_code), others use camelCase (e.g., npmAlternatives, npmChangelogAnalysis), and there are mixed styles like query-docs with hyphens. The NPM tools follow a consistent npmPrefix pattern internally, but this is not applied to other tools, leading to overall chaos.

Tool Count2/5

With 39 tools, this server is overloaded for a 'DevTools Collection' scope. The count feels excessive, as many tools could be consolidated (e.g., multiple analysis tools) or logically grouped. While the NPM tools are numerous but focused, the overall set lacks cohesion, making it cumbersome for an agent to navigate and select appropriate tools efficiently.

Completeness3/5

The toolset covers a broad range of development tasks, including code analysis, execution, documentation, and package management, but there are notable gaps. For example, there is no tool for code generation or refactoring, and the Microsoft and NPM tools are well-covered but isolated from other functionalities. The surface is extensive but not fully integrated, with some dead ends in workflow transitions.

Resources