Skip to main content
Glama

forge_selectors

Lists function selectors from compiled Foundry contracts, optionally filtered by contract name, to inspect and verify selector mappings for a project.

Instructions

List all function selectors from compiled contracts (forge selectors list).

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": {
      "projectPath": "<projectPath>"
    },
    "name": "forge_selectors"
  }
}

Input Schema

NameRequiredDescriptionDefault
profileNoFoundry profile to use (maps to FOUNDRY_PROFILE env var)
projectPathYesAbsolute path to the foundry project directory
contractNameNoFilter by contract name

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full burden. It does establish that this is a non-mutating list operation reading compiled artifacts, which is useful behavioral context, but it says nothing about whether a prior forge_build is required, how the results are shaped, or whether the list is exhaustively returned or truncated.

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?

A single front-loaded sentence with the resource, scope, and CLI mapping, and no filler. Slight imprecision in "all" relative to the available contractName filter keeps it from a 5.

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 annotations and no output schema, the description is the only source of behavioral information, and it omits return shape and the build prerequisite. For a simple read-only listing tool this is adequate to select the tool, but it leaves an agent guessing about setup requirements and result format.

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 all three parameters (projectPath, profile, contractName) are already documented in the schema. The description adds no parameter-level meaning and, notably, never mentions the contractName filter, so it does nothing to explain the tension between "list all" and a name filter.

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?

The description pairs a specific verb and resource ("List all function selectors") with the underlying CLI command, so the agent knows exactly what data comes back. It does not explicitly contrast itself with neighboring forge_* tools, but the resource is distinctive enough within the catalog to be unambiguous.

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: the phrase "from compiled contracts" hints that build artifacts must exist before calling, but that prerequisite is never stated as a condition. There is no mention of when to prefer this over, say, cast_interface or cast_abi_encode for selector lookups, and no exclusions.

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