Skip to main content
Glama

format_code

Format Python code in a file or directory with an ephemeral Ruff installation, avoiding the need to set up a formatter.

Instructions

Format Python code with an ephemeral Ruff installation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNoFile or directory to format. Defaults to the current directory.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior2/5

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

No annotations are provided, so the description carries full burden. It discloses the 'ephemeral Ruff installation' trait, which implies temporary installation, but omits that the tool likely modifies files in place, requires network access for installation, or performs cleanup. This is a significant gap for a tool with side effects.

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 a single, concise sentence that immediately conveys the tool's purpose. No filler or redundant content exists.

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

Completeness2/5

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

While the task is simple and an output schema exists, the description fails to disclose important behavioral context such as in-place file mutation and the implications of the ephemeral installation (network, disk usage, cleanup). For a tool with no annotations, this is insufficient for safe and correct use.

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 description coverage is 100%, with the schema fully documenting the 'path' parameter and its default. The description adds no additional parameter information, so the baseline 3 applies.

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 ('Format') and clearly identifies both the resource ('Python code') and the method ('with an ephemeral Ruff installation'). This distinguishes it from sibling tools focused on package management, environment setup, and running scripts.

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 purpose implies when to use the tool (formatting Python code), but there is no explicit guidance on when not to use it or any mention of alternative tools. Sibling tools like 'run' or 'run_script' could potentially format code via commands, but no such relationship is stated.

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/yriveiro/uv-mcp'

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