Skip to main content
Glama

analyze_data_flow

Identify variables' read/write/declaration status within a method to understand side effects before extracting it.

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.

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
Behavior4/5

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

The description discloses behavioral traits: it analyzes data flow, outputs variable information, and requires prior project loading. Since no annotations are provided, the description effectively covers the tool's behavior. It could mention potential errors or edge cases but is sufficient.

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: first sentence states purpose, followed by a usage example, output details, a use case, and a prerequisite. It is front-loaded and concise without being overly verbose.

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 the tool has no output schema and three parameters, the description provides a detailed account of the output fields (name, type, read/write/declaration, etc.) and a typical use case. It is complete for an analysis tool, though error handling is not addressed.

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?

The input schema already fully describes the three parameters with zero-based line/column hints. The description adds a usage example but no new semantic meaning beyond what the schema provides, meeting the baseline expectation.

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 clearly states the tool's purpose: analyzing data flow within a method. It provides a usage example and details of the output, making the purpose specific. However, it does not explicitly differentiate from sibling tools like analyze_control_flow, which could be confused with this tool.

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 gives a concrete use case (understanding side effects before extracting methods) and a critical prerequisite (requires load_project to be called first). It does not, however, specify when not to use the tool or list alternative tools for similar tasks.

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