Skip to main content
Glama

trpc_add_middleware

Generate authentication and logging middleware for tRPC projects. Specify a project directory to create and add the required middleware code.

Instructions

Generate tRPC middleware for auth and logging (Pro feature)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
api_keyNo
directoryYesProject directory
Behavior2/5

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

With no annotations, the description must carry behavioral disclosure, but it only implies that files are generated. It does not state what files are created, whether existing files are overwritten, whether an api_key is required to use the Pro feature, or how failures are reported.

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, well-front-loaded sentence that states the verb, deliverable, purpose, and licensing restriction without redundant wording.

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?

For a code-generation tool with no annotations, no output schema, and one undocumented parameter, the description is too brief to be complete. It omits execution behavior, prerequisites, what files are produced, and how `api_key` factors in, leaving an agent to guess at critical invocation details.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds no parameter-specific meaning. Although schema coverage is only 50% and `api_key` is undocumented, the description does not clarify the role of `api_key` or elaborate on `directory`; the '(Pro feature)' hint is too indirect to count as parameter 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 names a specific verb ('Generate'), a precise resource ('tRPC middleware'), and a clear scope ('for auth and logging'). This distinguishes it from framework-generating siblings like trpc_generate_router and trpc_generate_client, as well as from non-tRPC middleware tools.

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 phrase 'for auth and logging' implies when this tool is appropriate, and '(Pro feature)' adds a eligibility restriction. However, it does not name alternatives, exclusions, or when-not-to-use scenarios, so the guidance is only implied rather than explicit.

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/barnburner121/claude-plugin-marketplace'

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