Skip to main content
Glama

mock_response

Intercept fetch/XHR requests matching a URL pattern to return a canned response. Use it to test frontend behavior without a real backend until the page reloads.

Instructions

Intercept fetch/XHR requests matching a URL pattern and return a canned response. Useful for testing without a real backend. Injection survives until the page is reloaded.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bodyNoResponse body string{}
statusNo
url_patternYesSubstring or regex pattern to match the request URL
content_typeNoapplication/json

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv1.0.0

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It adds a key behavioral trait: 'Injection survives until the page is reloaded,' which informs the agent about the mock's lifespan. However, it doesn't mention side effects like whether new mocks override existing ones, whether all HTTP methods are intercepted, or how a mock is removed before reload.

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?

Two short sentences deliver the core purpose, a use case, and a critical behavioral detail with no filler. The most important information is front-loaded, making it easy for an agent to quickly understand the tool.

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

Completeness3/5

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

The description covers the primary behavior and lifespan, which is adequate for a straightforward mock tool. But given there is no output schema and no annotations, it would be stronger if it mentioned how mocks are cleared (related sibling 'clear_mock_responses'), behavior with multiple patterns, or whether the status/body defaults apply. It's complete enough for basic use but has notable gaps.

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?

Schema description coverage is 50%, with body and url_pattern documented, but status and content_type lack descriptions. The tool description only reinforces 'URL pattern' and does not add meaning for the undocumented status and content_type parameters. Thus it fails to compensate for the schema's gaps.

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 clearly states the tool's function with a specific verb ('Intercept') and resource ('fetch/XHR requests'), and specifies what it returns ('a canned response'). It is unambiguous and naturally distinct from siblings like 'navigate' or 'click', though it doesn't explicitly name or contrast with the closely related 'clear_mock_responses'.

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?

The description provides clear usage context: 'Useful for testing without a real backend.' This tells an agent when to consider this tool. It doesn't explicitly state when not to use it or mention alternatives such as 'clear_mock_responses', but the presence of an obvious use case is sufficient for a solid score.

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

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/hakanngul/testfly-mcp'

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