Skip to main content
Glama

analyze_script

Statically inspect a script to find functions, imports, complexity, and issues, and get actionable improvement suggestions for safer, clearer code.

Instructions

Statically analyse a script: functions, imports, complexity and issues.

Args: module_path: Dotted module path. project: Project name; defaults to the active project.

Returns: Analysis results and improvement suggestions.

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": {
      "module_path": "<module_path>"
    },
    "name": "analyze_script"
  }
}

Input Schema

NameRequiredDescriptionDefault
projectNo
module_pathYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/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 behavioral burden. 'Statically analyse' is a meaningful signal that nothing is executed or mutated and that the call is safe, and the Returns line sets expectations for output shape. It stops short of stating permission requirements, whether it reads from disk versus an in-memory project, or any size/time limits.

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 purpose sentence is front-loaded and information-dense, followed by compact Args and Returns blocks. The only near-waste is the Returns line, which duplicates information already carried by the output schema, but it is a single short sentence.

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 two-parameter read-only analysis tool with an output schema and no annotations, the definition covers purpose, both parameters, and return expectations, which is close to sufficient. The main gap is routing guidance among the many sibling script tools (syntax validation, indentation checks, formatting), which would prevent mis-selection.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate, and it does document both parameters: 'module_path' is clarified as a dotted path format, and 'project' is explained as defaulting to the active project, which the schema does not convey. The definitions are brief but cover every parameter with meaning beyond the titles.

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 opens with a specific verb+resource ('Statically analyse a script') and enumerates what the analysis yields (functions, imports, complexity, issues), which is clear enough that an agent understands the tool's domain. It does not name siblings such as validate_script_syntax or check_script_indentation, so differentiation relies on the reader inferring from the enumerated outputs.

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 word 'Statically' implies the script is not executed, which is useful implied context. However, there is no explicit 'use this when…' or 'use X instead for syntax-only checks', and no prerequisites such as whether the module must already exist in the project. Usage is only implied.

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

Deploy Server

Other Tools