Skip to main content
Glama

Analyze Function

analyze_function
Idempotent

Builds a dossier for a native function by symbol or address, including identity, pseudocode, assembly, calls, references, CFG blocks, and API boundary data.

Instructions

Build a dossier for one native function identified by symbol or provider-returned address. Returns identity with complete inclusive analyzed body ranges or explicit unknown, provider-specific pseudocode and assembly, comments, calls, references, referenced strings/names, local CFG blocks, and available native API boundary observations. Ghidra terminal-call assumptions that may cut the analyzed body are reported in limitations with available callee identities. Default detail summary returns a compact dossier (identity, pseudocode size, facet counts, value-flow availability) and retains the complete dossier Evidence in this session; page pseudocode, references, assembly, comments and value-flow through normalized_result.parent_evidence_id with inspect_analysis_view. detail complete returns the full dossier inline.

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": {
      "procedure": "<procedure>"
    },
    "name": "analyze_function"
  }
}

Input Schema

NameRequiredDescriptionDefault
detailNosummary (default) returns a compact dossier and retains the complete analyze_function Evidence in this session; page pseudocode, references and value-flow through normalized_result.parent_evidence_id with inspect_analysis_view. complete returns the full dossier inline.
procedureYes

Output Schema

NameRequiredDescriptionDefault
subjectYes
providerYes
authorityYes
locationsYes
operationYes
confidenceYes
parametersYes
raw_resultYes
environmentYes
evidence_idYes
limitationsYes
evidence_linksYes
predicate_typeYes
analysis_profileYes
caller_input_pathNo
normalized_resultYes
caller_input_pathsNo
relationship_coverageYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.25.0

TDQS

A3.6/5.0
Behavior4/5

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

Beyond the annotations, it discloses meaningful behavior: the default summary mode retains the full Evidence in this session (explaining why readOnlyHint is false), unknown values are reported explicitly rather than fabricated, and Ghidra terminal-call truncation of the analyzed body is surfaced in limitations with callee identities. It does not describe failure behavior when the symbol cannot be resolved, which is the remaining gap.

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

Conciseness3/5

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

The purpose is front-loaded correctly, but the remaining sentences are long, comma-chained inventories packed into run-ons. Every clause carries information, yet the density makes the summary-versus-complete behavior harder to scan than it needs to be.

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 complex analysis tool, this covers the returned facets, the summary/complete trade-off, session retention of Evidence, paging via normalized_result.parent_evidence_id, and known accuracy limitations. With an output schema present, return-value format need not be explained, and only the unresolved-symbol failure path is unaddressed.

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 coverage is 50%, with the detail parameter already fully documented in the schema — the description largely restates its enum semantics. It does add value for the undocumented procedure parameter by saying it accepts a symbol or a provider-returned address, which the bare 'type: string' schema does not convey, but it omits any format or ambiguity-handling detail.

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 gives a specific verb and resource: 'Build a dossier for one native function identified by symbol or provider-returned address,' and enumerates the facets returned (identity, body ranges, pseudocode, assembly, comments, calls, references, CFG blocks, API boundary observations). That clearly sets it apart from narrower siblings such as procedure_pseudo_code or procedure_callers, though it never names those alternatives 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?

The description explains the summary-vs-complete routing and points to inspect_analysis_view for paging, which is real usage guidance for the detail parameter. It does not state when an agent should choose this comprehensive dossier over the narrower sibling tools, leaving that inference to the reader.

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