Skip to main content
Glama
drvcvt
by drvcvt

get_control_flow_graph

Retrieve a function's control flow graph as JSON with basic blocks and edges to analyze execution paths in a binary.

Instructions

Get the control flow graph of a function as a JSON structure with basic blocks and edges.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressNoHex address of the function (e.g. "0x08048000")
binary_pathYesAbsolute path to the binary file
function_nameNoName of the function (e.g. "main")

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.2/5.0
Behavior3/5

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

The description discloses the return shape—JSON with basic blocks and edges—which is useful given there is no output schema. However, with no annotations, it does not explain read-only behavior, precedence rules when both address and function_name are supplied, or failure cases such as an unresolved function.

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?

The description is a single, focused sentence that immediately conveys the operation and output format. It contains no filler and is appropriately front-loaded with the primary purpose.

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

Completeness2/5

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

For a tool with no annotations and no output schema, the description leaves important context missing: how to select a function via address versus name, which parameter is required in practice, and how this relates to alternative analysis tools. The core purpose is clear, but an agent lacks enough information to invoke it correctly in ambiguous cases.

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 the schema already documents all three parameters. The description adds no additional meaning to address, binary_path, or function_name, and does not explain the relationship or mutual exclusivity between the two optional function identifiers.

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 states a clear verb and resource: it gets the control flow graph of a function. It also distinguishes itself from sibling get_callgraph by scoping to a function's CFG rather than a call graph. However, it does not explicitly differentiate itself from nearby function-analysis tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided about when to use this tool versus alternatives such as get_callgraph, disassemble, decompile_function, or analyze_function_deep. It also fails to clarify whether callers should provide address, function_name, or both, which is essential for correct usage.

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