Skip to main content
Glama

rate_generate_middleware

Generate rate limiting middleware for Express, Fastify, Koa, Hono, or NestJS. Set configurable time windows and request limits to protect APIs from abuse.

Instructions

Generate rate limiting middleware for Express, Fastify, or Koa with configurable windows

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
key_byNoRate limit key strategy
api_keyNoAPI key for authentication
frameworkYesWeb framework
window_msYesRate limit window in milliseconds
max_requestsYesMaximum requests per window
Behavior2/5

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

With no annotations provided, the description carries the full burden, but it does not disclose what 'generate' actually does: whether it writes files, returns code snippets, modifies existing projects, or requires authentication. The api_key parameter implies auth may be needed, yet the description is silent on this.

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 13-word sentence that is front-loaded with the verb and resource, containing zero filler or redundancy. It is appropriately sized for what it communicates, even though other dimensions penalize its sparseness.

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?

Inadequate for a code-generation tool with 5 parameters, no output schema, and no annotations. The description omits what the generated middleware looks like, side effects, authentication requirements, and the hono/nestjs options present in the schema. An agent cannot safely invoke this tool correctly based on the description alone.

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 of 3 applies. The phrase 'configurable windows' loosely maps to window_ms, but the description adds no real semantic value beyond what the schema's parameter descriptions already provide.

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 states a specific verb and resource ('Generate rate limiting middleware') with target frameworks, which distinguishes it from other middleware siblings like cors_generate_middleware and retry_generate_middleware. However, the schema's framework enum also includes hono and nestjs, which the description omits, creating a slight mismatch.

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?

No guidance on when to use this tool versus alternatives. Sibling tools like rate_configure_strategies, rate_add_redis, and generate_express_middleware overlap in scope, but the description provides no basis for choosing among them and states no exclusions or prerequisites.

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