Skip to main content
Glama

get_http_endpoints

Assemble a Java project's HTTP route table from Spring and JAX-RS annotations. Extract each endpoint's method, path, handler, framework, and location after loading the project.

Instructions

Assemble the project's HTTP route table.

USAGE: get_http_endpoints() OUTPUT: route -> handler entries (HTTP method, effective path, handler method, framework, location), sorted by path.

Supports:

  • Spring verb shortcuts: @GetMapping, @PostMapping, @PutMapping, @DeleteMapping, @PatchMapping; the class-level @RequestMapping value is composed as the path prefix.

  • JAX-RS (jakarta.ws.rs and javax.ws.rs): @GET/@POST/... verbs with class-level and method-level @Path composed.

Method-level @RequestMapping(method=...) routes are not assembled; verb-shortcut annotations are the supported Spring form.

Handlers are listed where a framework can register them: in a named top-level or static member class, interface, record or enum. A verb-annotated method of an anonymous class, a local class or a non-static inner class, or an element of an annotation type, is no route and is not listed. A handler whose signature names a type that does not resolve is listed like any other.

Projects without these frameworks return an empty table.

potentialMatches lists, the first maxResults by file and position, the verb annotations JDT could not confirm, each with the annotation it names; none is a route.

Options:

  • maxResults: cap the reported endpoints (default 200)

potentialMatches, present only when there are any, holds the places JDT's search reports as possible matches but cannot confirm, because a type or name there does not resolve (a missing dependency or a compile error): count is their exact number, and locations lists them, as many as the results it stands beside may list. They are never counted or listed as results.

Requires load_project to be called first.

Input Schema

NameRequiredDescriptionDefault
maxResultsNoMaximum endpoints to return (default 200)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.5.0

TDQS

A4.3/5.0
Behavior5/5

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

With no annotations at all, the description carries the full behavioral burden and does so unusually well: it discloses the supported Spring verb shortcuts, the explicitly unsupported method-level @RequestMapping form, the class-shape rules for what counts as a registrable handler (excluding anonymous/local/non-static inner classes and annotation-type elements), that handlers with unresolvable signature types are still listed, and the precise semantics of potentialMatches including that they are never counted or listed as results.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose and prerequisite are front-loaded, but the body is sprawling and the potentialMatches behavior is covered twice, once in a garbled fragment ('potentialMatches lists, the first maxResults by file and position, the verb annotations JDT could not confirm') and again later in coherent prose. A tighter single paragraph would carry the same information with less risk of confusing the agent.

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?

For a complex, zero-annotation, no-output-schema analysis tool, the description covers output shape, supported and unsupported annotation forms, handler-eligibility rules, the empty-project case, the potentialMatches payload and its limits, and the load_project dependency. Nothing an agent needs to call it correctly is missing.

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?

There is a single optional parameter and schema description coverage is 100%, so the schema already documents maxResults. The description restates it ('cap the reported endpoints (default 200)') without adding format, range, or interaction details, which is the baseline 3 for a schema that 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 opening line states a concrete verb and resource: 'Assemble the project's HTTP route table.' The chrome of what the table contains (method, effective path, handler, framework, location) is spelled out, and no sibling tool in the list produces HTTP routes, so the agent can distinguish it immediately from get_di_registrations, get_jpa_model, or find_annotation_usages.

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?

'Requires load_project to be called first' gives a hard prerequisite, and 'Projects without these frameworks return an empty table' tells the agent what a null-looking result means. It does not name a when-not case or point at an alternative tool, so it stops short of the explicit routing guidance that earns a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.