Skip to main content
Glama
anaseqal

MCP Code Mode

by anaseqal

run_with_retry

Execute Python code with automatic retry and intelligent error analysis. On failure, it diagnoses the error, searches past solutions, and suggests fixes for robust execution.

Instructions

Execute Python code with intelligent retry and error analysis.

On failure, this tool:

  1. Analyzes the error pattern

  2. Searches past learnings (both error-based and semantic) for solutions

  3. Provides diagnostic information

  4. Suggests fixes based on error type and similar objectives

IMPORTANT: Use record_semantic_failure() if code runs successfully but doesn't accomplish the objective. This helps the system learn from non-error failures.

Use this for more robust execution when errors are expected or when learning from previous similar tasks.

Args: code: Python code to execute description: Task description (helps find relevant semantic learnings) max_retries: Max retry attempts (same code) timeout: Execution timeout in seconds

Returns: Detailed execution result with retry info and suggestions from both error and semantic learnings

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes
descriptionNo
max_retriesNo
timeoutNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

No annotations provided, but description fully details the retry mechanism: analyzing errors, searching learnings, providing diagnostics and suggestions. Discloses retry count, timeout, and post-failure analysis. No contradictions.

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?

Well-structured with summary, bullet points, usage note, parameter list, and return description. Minor redundancy ('error and semantic learnings' appears twice) but overall concise for the amount of information.

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

Completeness5/5

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

Covers all aspects: purpose, behavior on failure, parameter explanations, usage guidance, return value. Output schema exists and description appropriately mentions return type. References sibling tools for additional context.

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?

Schema has 0% description coverage, but description adds meaningful explanations for all four parameters: code, description (helps find semantic learnings), max_retries (max retry attempts), timeout (execution timeout). Adds value beyond 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 'Execute Python code with intelligent retry and error analysis.' It specifies the verb and resource, and distinguishes from siblings like run_python (no retry) and run_python_stream (streaming).

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

Usage Guidelines4/5

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

Explicitly says 'Use this for more robust execution when errors are expected or when learning from previous similar tasks.' Also advises using record_semantic_failure for non-error failures, providing clear usage context. Could be slightly more explicit about when not to use.

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/anaseqal/codemode'

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