Skip to main content
Glama

fix_solidity

Apply Solhint autofixes to a Solidity source string and return the corrected code without modifying any files.

Instructions

Apply Solhint autofixes to a Solidity source string and return the corrected source. Does not touch any file.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesSolidity source code to fix
configNoOptional complete Solhint config object

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.3

TDQS

A3.8/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It does disclose the important non-destructive trait (operates on a string, does not touch files) and states the return value, which is genuinely useful. It is silent on what happens with unfixable violations, whether an invalid config errors out, and whether a Solhint config is required or defaulted.

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?

Two tight sentences with zero padding; the primary action and the key non-destructive caveat are front-loaded in that order. Nothing can be removed without losing information.

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?

There is no output schema, but the description explicitly says it returns the corrected source, which covers the return contract. For a 2-parameter tool with full schema coverage the definition is nearly sufficient, with only edge-case failure behavior left undescribed.

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%, so both parameters (code, config) are already documented in the schema, establishing the baseline of 3. The description restates that the input is a Solidity source string but adds no extra semantics, such as whether config is merged with defaults or which rules apply when it is omitted.

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 names a specific verb (apply Solhint autofixes), a specific resource (a Solidity source string), and the return value (the corrected source). The clause 'Does not touch any file' implicitly disambiguates it from the sibling fix_file, so an agent can select between them without opening schemas.

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?

Usage is implied rather than stated: the tool is the in-memory counterpart to fix_file, and 'Does not touch any file' hints at that boundary. However, there is no explicit when-to-use/when-not guidance relative to lint_solidity or fix_file, so the agent must infer the routing.

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