Skip to main content
Glama
nhuson269

MCP Spring Boot Toolkit

by nhuson269

generate_exception_handler

Generate a global exception handler for Spring Boot apps. Define custom exceptions and map error responses to HTTP status codes.

Instructions

Generate global exception handler with @ControllerAdvice and custom exceptions

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
exceptionsNoCustom exception classes to generate
packageNameNoBase package namecom.example.demo
Behavior2/5

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

No annotations are provided, so the description must disclose behavioral traits. It only states the output concept but omits key details such as file creation, overwrite behavior, or whether custom exception classes are also generated. This is a significant gap for a code generation tool.

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 a single, focused sentence that fully captures the tool's purpose without unnecessary detail. It is front-loaded and every word adds value.

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

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no annotations and no output schema, the description should explain what the tool produces and any side effects. It does not mention generated files, return values, or how the custom exceptions are integrated, leaving the agent to infer crucial behavior. The nested exceptions parameter adds complexity that 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?

Schema description coverage is 100%, so the baseline is 3. The description adds no extra semantic meaning beyond the schema, which already documents exceptions and packageName. It does not clarify how parameters influence the generated handler's behavior.

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 generates a global exception handler with @ControllerAdvice and custom exceptions, using a specific verb and resource. This distinguishes it from sibling tools like generate_controller or generate_service, which handle different layers.

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

Usage Guidelines3/5

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

The description implies usage for creating a centralized exception handler but does not explicitly state when to use it versus alternatives, nor does it mention exclusions or prerequisites. It relies on the tool name and context of sibling generators.

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/nhuson269/mcp-spring-boot-toolkit'

If you have feedback or need assistance with the MCP directory API, please join our Discord server