Skip to main content
Glama

tenant_generate_middleware

Generate tenant resolution middleware that extracts the tenant from subdomain, header, JWT, path, or query and propagates tenant context in Express, Fastify, or NestJS.

Instructions

Generate tenant resolution middleware with context propagation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
api_keyNoAPI key for authentication
frameworkNoServer frameworkexpress
resolutionNoHow to identify the tenant from requestssubdomain
include_cachingNoWhether to cache tenant lookups
Behavior2/5

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

With no annotations, the description carries the full burden of disclosing side effects, output format, whether files are written, or authentication needs. It only restates generation and context propagation, leaving the tool's actual behavior opaque.

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?

A single front-loaded sentence with no filler; every word adds meaning. The core action, artifact, and distinguishing feature are all present.

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?

The tool is a code-generation operation with no output schema or annotations, so the description needs to explain expected artifacts and integration behavior. Parameters are clear, but the outcome, side effects, and selection context are absent.

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 all four parameters are already documented in the input schema. The description adds no additional parameter-level meaning, making the baseline 3 appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a concrete artifact and capability: tenant resolution middleware with context propagation. It is clear and specific enough to distinguish from tenant_design_schema or tenant_isolation_setup, but it does not explicitly contrast itself with sibling middleware generators such as generate_express_middleware.

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

Usage Guidelines2/5

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

There is no guidance about when to choose this tool over related middleware or scaffolding tools. The description only states what it produces, not the context, prerequisites, or alternatives.

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