Skip to main content
Glama
trailofbits

Slither MCP Server

Official
by trailofbits

get_contract_source

Retrieve a contract's source code from the Solidity file, with optional line range filtering for focused analysis.

Instructions

Retrieves the source code of a contract from the original Solidity file. Use this when you need to read the actual implementation after finding a contract with list_contracts. Returns the source code as a string with optional line range filtering via start_line and max_lines parameters. Only returns the contract's portion of the file; for the full file, read it directly.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
requestYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
successYes
file_pathNoFile path relative to project directory
truncatedNoTrue if the source was truncated due to max_lines limit
source_codeNo
total_linesNoTotal number of lines in the source file
error_messageNo
returned_linesNoLine range returned (start, end) - 1-indexed, inclusive
Behavior3/5

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

No annotations provided, so description carries full burden. It explains return format (string) and optional line range filtering via start_line and max_lines. However, it lacks details on error scenarios, permissions, or performance implications.

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 sentences, no wasted words. First sentence states core purpose, second adds usage guidance and parameter details. Highly efficient and well-structured.

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?

For a retrieval tool with an output schema, description covers purpose, usage context, and filtering options. Lacks mention of error handling or prerequisites beyond list_contracts, but sufficient for agent understanding.

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 0%, so description must add meaning beyond schema. It mentions start_line and max_lines parameters and their filtering role, but does not explain contract_key or path. Some value added but not comprehensive.

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?

Description explicitly states verb 'Retrieves' and resource 'source code of a contract from the original Solidity file', clearly distinguishing it from sibling tools like get_function_source or get_contract by specifying it returns only the contract's portion of the file.

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?

Provides explicit usage context: 'Use this when you need to read the actual implementation after finding a contract with list_contracts.' Also gives an alternative for full file reading, though does not name the specific sibling tool.

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/trailofbits/slither-mcp'

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