Skip to main content
Glama

get_function_source

Read-onlyIdempotent

Retrieve line-numbered source and metadata for any Solidity function or modifier, including internal, private, and library code, plus outgoing calls to inspect call flows.

Instructions

Get the source (line-numbered) and metadata of any function or modifier, including internal/private ones and those in libraries, plus its outgoing calls.

Args:
    repo_path: Project root.
    function: "Contract.fn(type1,type2)", "Contract.fn", or bare "fn" if unique.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "repo_path": "<repo_path>",
      "function": "<function>"
    },
    "name": "get_function_source"
  }
}

Input Schema

NameRequiredDescriptionDefault
functionYes
repo_pathYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and openWorldHint=false, so safety is covered. The description goes beyond that by disclosing what is returned (line-numbered source, metadata, outgoing calls), which is important since there is no output schema. It does not say what happens on lookup failure or ambiguity beyond the 'if unique' hint.

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?

Front-loaded with the core action and return content, then a compact Args block with no filler. Every sentence adds information an agent needs.

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 two-parameter read-only tool with no output schema, the description covers what is returned and how to address the target, which is most of what an agent needs. Minor gaps are failure behavior and disambiguation versus sibling tools.

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

Parameters4/5

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

Schema description coverage is 0%, so the description carries the full burden, and it does well: repo_path is identified as the project root, and the function argument's three accepted forms (Contract.fn(type1,type2), Contract.fn, bare fn if unique) are spelled out. Only repo_path's semantics are thin, and there is no detail on path normalization or error behavior for an ambiguous bare name.

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

Purpose4/5

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

States a specific verb (Get) and precise resource (source, line-numbered, plus metadata and outgoing calls) and enumerates the covered cases: internal/private functions and library functions. It does not distinguish itself from siblings like get_flow or get_type_definition, so an agent must infer that this is the source-retrieval tool versus the flow or type tools.

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 by the purpose: call this when you need the actual source of a function. There is no explicit when-to-use vs when-to-use-another-tool guidance and no named alternative, though the 'bare fn if unique' rule implicitly warns about ambiguity. Adequate but leaves routing to inference.

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