Skip to main content
Glama

analyze_data_flow

Analyze data flow within a Java method to track variable reads, writes, and declarations. Optionally follow calls to detect null and taint facts across methods.

Instructions

Analyze data flow within a method.

USAGE: analyze_data_flow(filePath="path/to/File.java", line=10, column=5) OUTPUT: Variables with read/write/declaration info

Reports for each variable:

  • name and type

  • whether it is declared, read, written

  • whether it is a parameter, local variable, or field

  • return statement count and types

Useful for understanding side effects before extracting methods.

Options:

  • followCalls: opt-in interprocedural mode (default false). Tracks two fact kinds across argument-to-parameter hops into project callees and reports interproceduralFlows:

    • null facts - locals assigned null; sink = a dereference of the tracked value in a callee (potential NPE)

    • taint facts - this method's parameters, propagated through aliases and expressions; sink = the value escaping into a non-project (binary) callee May-analysis: reassignments do not kill facts. Returned values are not tracked back into callers.

  • maxCallDepth: call-edge bound for followCalls (default 2)

Requires load_project to be called first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filePathYesFile containing the method
lineYesZero-based line number within the method
columnYesZero-based column number
followCallsNoTrack null/taint facts across method calls (default false)
maxCallDepthNoCall-edge bound for followCalls (default 2, min 1)
Behavior4/5

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

No annotations provided, so the description carries full burden. It explains output details (variables, read/write/declaration info) and provides extensive behavior for followCalls mode, including null and taint facts, may-analysis, and tracking limitations.

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 description is well-structured with sections, starts clearly, and is not overly verbose given the complexity of the tool. It could be slightly more concise but effectively covers key points.

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?

No output schema, but description adequately explains output format. It mentions prerequisite (load_project) and covers all parameters. For the complexity of the tool, it is sufficiently complete.

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 coverage is 100%, baseline is 3. The description adds value by showing usage format, clarifying zero-based indexing, and explaining followCalls and maxCallDepth in detail beyond schema descriptions.

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 'Analyze data flow within a method' and provides a usage example. It distinguishes itself from sibling tools like analyze_control_flow or analyze_change_impact by focusing on data flow and variable tracking.

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 mentions it is 'useful for understanding side effects before extracting methods' and that it requires load_project first. However, it does not explicitly state when not to use it or compare to alternatives, leaving room for ambiguity.

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/pzalutski-pixel/javalens-mcp'

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