Skip to main content
Glama

analyze_file

Analyze Java source files to extract file information, imports, types with member counts, and compilation diagnostics in one operation.

Instructions

Comprehensive file analysis in a single call.

Combines:

  • File info (path, package, line count)

  • All imports (with static/on-demand flags)

  • All types with member counts

  • Compilation diagnostics (errors/warnings)

Use this instead of multiple calls to get_document_symbols + get_diagnostics.

Requires load_project to be called first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filePathYesPath to source file
includeMembersNoInclude full member details for each type (default false)
includeDiagnosticsNoInclude compilation errors/warnings (default true)
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. It discloses that this is a comprehensive analysis tool combining multiple data sources, mentions it requires load_project first (implying a dependency), and hints at performance benefits by avoiding multiple calls. However, it doesn't detail rate limits, error handling, or output format specifics.

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 efficiently structured with a bold summary line, a bulleted list of components, and two clear usage sentences. Every sentence adds value without redundancy, making it easy to scan and understand quickly.

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 (comprehensive analysis with 3 parameters) and no annotations or output schema, the description does well by explaining what it combines, when to use it, and prerequisites. However, it lacks details on return format or error conditions, which would be helpful for a tool with no output schema.

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 thoroughly. The description doesn't add any parameter-specific information beyond what's in the schema, but it implies the tool's comprehensive nature relates to the parameters' effects. Baseline 3 is appropriate when schema does the heavy lifting.

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 explicitly states 'Comprehensive file analysis in a single call' and lists specific components analyzed (file info, imports, types, diagnostics), providing a clear verb+resource combination. It distinguishes from siblings like get_document_symbols and get_diagnostics by noting it combines their functionality.

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 guidance: 'Use this instead of multiple calls to get_document_symbols + get_diagnostics' and 'Requires load_project to be called first.' This clearly indicates when to use this tool versus alternatives and specifies a prerequisite.

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