Skip to main content
Glama

analyze_data_flow

Analyze data flow within Java methods to identify variable usage patterns, side effects, and dependencies for method extraction and refactoring.

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?

With no annotations provided, the description carries the full burden of behavioral disclosure. It clearly describes what the tool does (analyzes data flow), what it outputs (variables with read/write/declaration info), and specific behavioral constraints (requires load_project first). It doesn't mention error conditions, performance characteristics, or rate limits, but provides substantial operational context.

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 clear sections (purpose, usage example, output description, usage context, prerequisite). It's appropriately sized at 7 sentences, though the usage example could be integrated more naturally rather than as a separate line. Every sentence adds value with no wasted words.

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's complexity (data flow analysis), lack of annotations, and no output schema, the description does a good job explaining what the tool does, when to use it, and what it returns. It could benefit from more detail about the output format structure or error conditions, but it provides sufficient context for an agent to understand the tool's purpose and basic operation.

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 (filePath, line, column) with their types and descriptions. The description provides a usage example with the parameters but doesn't add significant semantic meaning beyond what the schema already states. The baseline of 3 is appropriate when schema coverage is complete.

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: 'Analyze data flow within a method' with specific details about what it reports (variables with read/write/declaration info). It distinguishes itself from sibling tools like analyze_control_flow or analyze_method by focusing specifically on data flow analysis rather than control flow or general method analysis.

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

Usage Guidelines5/5

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

The description provides explicit usage guidance: it states 'Useful for understanding side effects before extracting methods' and 'Requires load_project to be called first.' This gives clear context for when to use this tool (before method extraction) and a prerequisite dependency, distinguishing it from alternatives.

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