Skip to main content
Glama

trace_effects

Traverses a function's call graph to collect all direct and transitive side effects, including IO, mutations, and cross-module boundary crossings.

Instructions

Trace transitive side effects of a function through its call graph.

For any function, traverses CALLS edges (DFS) and collects effects from leaf nodes using the effects-db (Node.js builtins, npm packages).

Use this when you need to:

  • "What side effects does this function have?" → direct + transitive effects

  • "Does this handler do IO?" → trace shows IO:FILE:READ from fs.readFileSync at depth 3

  • "Where does the fetch() call come from?" → leaf_sources shows the origin at depth N

  • "What crosses module boundaries?" → boundary_crossings shows file-to-file effect flow

Effect types: PURE, MUTATION, IO (with subtypes like IO:FILE:READ, IO:HTTP:REQUEST), THROW, ASYNC, NONDETERMINISTIC, UNKNOWN.

UNKNOWN means: unresolved call, external package not in effects-db, or depth limit reached.

Returns: direct effects, transitive effects, boundary crossings, leaf sources.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nodeYesFunction/method name or semantic ID
fileNoFile path to disambiguate (optional)
max_depthNoMaximum call graph traversal depth (default: 10)
Behavior4/5

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

With no annotations, the description fully discloses behavior: it uses DFS traversal, collects effects from leaf nodes via effects-db, handles UNKNOWN for unresolved calls, and returns direct/transitive effects, boundary crossings, and leaf sources. It does not mention performance or rate limits, but the core behavior is well explained.

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 concise and well-structured: a one-sentence summary, bullet-pointed use cases, effect type explanation, and return value summary. Every sentence is useful, and the key information is front-loaded.

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?

Given no output schema, the description explains return values thoroughly (direct/transitive effects, boundary crossings, leaf sources) and defines effect types and UNKNOWN. It could be more complete by mentioning prerequisites or performance considerations, but it covers the essential context for an AI agent.

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 100%, so baseline is 3. The description adds no new semantic information beyond the schema's parameter descriptions (node, file, max_depth). The schema already describes these adequately, and the description does not enrich them further.

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

Purpose5/5

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

The description clearly states the tool's purpose: tracing transitive side effects of a function through its call graph. It uses a specific verb ('Trace') and resource ('side effects'), and the detailed explanation distinguishes it from sibling tools like trace_calls by focusing on effects rather than just call chains.

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

Usage Guidelines4/5

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

The description explicitly gives use cases (e.g., 'What side effects does this function have?', 'Does this handler do IO?'), which helps an agent decide when to use this tool. While it does not name alternative tools directly, the context provides clear guidance on the tool's specific role among siblings.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Disentinel/grafema'

If you have feedback or need assistance with the MCP directory API, please join our Discord server