Skip to main content
Glama

Code Format

transform_code_format
Read-only

Format source code with language-aware indentation and style rules. Supports JS, TS, Python, Go, Rust, and more. Use when standardizing code style or preparing snippets for documentation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesSource code to format
languageYesProgramming language (javascript, json, html, css, sql, xml)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

C2.8/5.0
Behavior3/5

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

Annotations provide readOnlyHint: true, so the agent knows this is a safe read operation. The description adds that formatting is language-aware and focuses on style rules, which is useful but does not disclose other behavioral details like output format or error handling. No contradiction exists between description and annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is only three sentences, but the second sentence about supported languages is both inaccurate and redundant given the schema. It wastes space and introduces misinformation. A concise, accurate description would focus on the actual supported languages and clearly differentiate from sibling formatting tools.

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?

The description is incomplete for a tool with no output schema and multiple siblings. It fails to mention the actual language enum or how it differs from transform_sql_format and minify tools. It also claims unsupported languages, creating a significant completeness gap. Annotations cover read-only behavior, but the description omits essential return-value and supported-language context.

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

Parameters1/5

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

The schema already documents both parameters fully (100% coverage), so the baseline is 3. However, the description's language list (JS, TS, Python, Go, Rust) directly contradicts the schema enum (javascript, json, html, css, sql, xml). This actively misleads the agent into passing unsupported language values, making the description worse than if it had no parameter info.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool formats source code with style rules, but the claimed language support (JS, TS, Python, Go, Rust) contradicts the schema enum, which only includes javascript, json, html, css, sql, xml. This makes the purpose misleading. It also fails to distinguish from the sibling tool transform_sql_format, which would be a more specific alternative for SQL.

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?

The description provides clear usage context: 'Use when standardizing code style or preparing snippets for documentation.' This tells the agent when to invoke the tool. However, it does not mention any exclusions or alternatives, such as transform_sql_format for SQL-only formatting, so it lacks full differentiation.

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.

Resources