Skip to main content
Glama

get_type_definition

Read-onlyIdempotent

Retrieves a Solidity struct, enum, or user-defined value type definition plus one level of referenced user types, helping inspect contract data models by repo path and type name.

Instructions

Get the definition of a struct, enum, or user-defined value type, plus the definitions of user types its members reference (one level per call).

Args:
    repo_path: Project root.
    name: Type name, bare ("PoolKey") or qualified ("Morpho.Position").

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>",
      "name": "<name>"
    },
    "name": "get_type_definition"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYes
repo_pathYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already establish that this is a safe, idempotent, non-open-world read, so the safety profile needs no repetition. The description adds one genuinely useful behavioral detail — expansion is limited to one level of referenced user types per call — but says nothing about failure modes for unknown or ambiguous names, or about how results are structured.

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

Conciseness4/5

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

The core behavior is front-loaded in the first sentence, with the recursion limit attached as a parenthetical right where it matters. The Args block is compact and earns its space by adding format detail, though the multi-line wrapping adds a little visual noise.

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

Completeness3/5

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

With no output schema, the description must convey the return shape, and it only says a definition plus referenced user-type definitions come back, without indicating whether that is source text, a structured signature, or a file location. For a code-analysis lookup tool this leaves a real gap, though the call itself is fully specified.

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 must carry the parameters, and it does: repo_path is identified as the project root, and name is documented with the accepted bare ('PoolKey') and qualified ('Morpho.Position') forms. The format examples are the key value add, though qualification rules (when a bare name is ambiguous) remain unstated.

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 and resource: it retrieves the definition of a struct, enum, or user-defined value type. It also clarifies the scope of what comes back (referenced user types, one level deep), which separates it in practice from siblings like get_function_source or get_flow, though no sibling is named explicitly.

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 only implied: an agent can infer it should call this when it needs a type's shape, and 'one level per call' hints that repeated calls are needed to walk a graph. There is no explicit when-to-use versus when-not, no prerequisites, and no guidance on what to do if the type is not found.

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