Skip to main content
Glama

get_jpa_model

Scan Java classes for JPA annotations (@Entity, @Table, @Id, relationships) and assemble the entity model with table names, ID fields, and relationship details.

Instructions

Assemble the project's JPA entity model.

USAGE: get_jpa_model() OUTPUT: Entities with table name, id field, and relationships (kind, target entity, mappedBy side), with locations.

Scans @Entity types (jakarta.persistence and javax.persistence) and reads @Table, @Id, and @OneToMany/@ManyToOne/@OneToOne/ @ManyToMany field annotations. Relationship targets are resolved from the field's type binding, including through collection type arguments (List -> Order).

Projects without JPA on the classpath return an empty model.

Options:

  • maxResults: cap the reported entities (default 100)

Requires load_project to be called first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
maxResultsNoMaximum entities to return (default 100)
Behavior5/5

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

With no annotations, the description fully discloses scanning behavior (Entity, Table, Id, relationships), target resolution method, and empty model for non-JPA projects. No contradictions.

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 well-structured with usage, output, scanning details, and prerequisites. Every sentence adds value without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/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 adequately describes the output (entities with table name, id, relationships, locations). It covers prerequisites, parameter default, and edge cases.

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% and the parameter description already includes the default value. The tool description repeats this info without adding new semantics.

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 it assembles the JPA entity model, specifies the output includes tables, IDs, and relationships, and distinguishes it from sibling tools by focusing on JPA entities.

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 states the prerequisite 'Requires load_project to be called first' and notes behavior when JPA is absent. It lacks explicit comparison to alternatives but the tool is unique enough.

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