Skip to main content
Glama
gclluch
by gclluch

find_errors

Scan a Python file for coding hazards: bare excepts, mutable default arguments, unawaited coroutines, and other common bugs.

Instructions

Find Python-specific hazards: bare/broad except, except: pass, handlers made unreachable by an earlier one, mutable default args, mutable @dataclass field defaults (an import-time ValueError), unawaited coroutines (best effort), assert used for runtime validation, late-binding closures over a loop or comprehension variable, == against None/True/False, is against a literal, and methods that never use self.

Args: path: Path to a .py file. function: Optional single function to analyse.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
functionNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

Given no annotations, the description carries the full burden of behavioral disclosure. It provides a detailed inventory of checks, including nuances like 'best effort' for unawaited coroutines and 'import-time ValueError' for mutable dataclass defaults. However, it does not explicitly state that the tool is read-only or describe side effects, though the nature of 'find errors' implies analysis.

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 front-loaded with the purpose, then lists hazards in a compact bulleted style within a paragraph, and closes with concise parameter docs. Every sentence serves a purpose, and the list is dense but not verbose.

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

Completeness4/5

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

The description is thorough in listing checks and parameter meanings. Since an output schema exists, the absence of return-value details is acceptable. It lacks explicit guidance on when to use this over sibling tools, but the core behavior is well specified for a static-analysis tool.

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

Parameters5/5

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

The input schema has zero description coverage, but the description's Args section compensates by defining each parameter: 'path' as a .py file and 'function' as an optional single function to analyze. This adds clarity beyond the schema's bare titles.

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 'Find Python-specific hazards' and enumerates specific error-prone patterns, distinguishing it from siblings like code_smells and dead_code by focusing on concrete Python hazards. The verb+resource structure is explicit and 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 usage for static analysis of a .py file via the parameter docs, but it does not explicitly state when to use this tool versus alternatives like code_smells or analyze_file, nor does it mention exclusions. The context is clear enough to infer a typical use case, but no alternatives or when-not-to-use guidance is provided.

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/gclluch/py-ast-mcp'

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