Skip to main content
Glama

intercept_network

Mock API responses by intercepting requests matching a URL substring. Return custom status, body, and content-type to simulate error, empty, or loading states without a backend.

Instructions

Mock matching API responses on a session — return a custom status/body/content-type for requests whose URL contains a substring. Returns {success}. Use it to force error, empty, or loading states without a real backend; call BEFORE the triggering action, and clear_intercepts to remove. once=true intercepts only the first match.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bodyNoResponse body (JSON string or plain text)
onceNoOnly intercept the first matching request (default: false)
methodNoHTTP method filter (optional, e.g. 'GET', 'POST')
statusNoHTTP status code to return (default: 200)
session_idYesSession ID
url_patternYesPlain substring of the full URL to match (e.g. '/api/tasks', 'graphql') — not a regex or glob.
content_typeNoContent-Type header (default: 'application/json')
Behavior4/5

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

Describes core behavior (mock responses via URL substring, once option) and return value, but omits details like intercept lifetime (until cleared or session ends) and behavior when multiple intercepts match. No annotations provided, so description carries full burden.

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 sentences: first defines purpose, second provides usage guidelines and parameter note. Every sentence is essential and well-structured.

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

Completeness4/5

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

Covers purpose, usage, key parameter, and return value. Lacks discussion of error cases or behavior with multiple matches, but sufficient for a mocking tool. No output schema or annotations to supplement.

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

Parameters4/5

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

Schema coverage is 100%, so baseline is 3. Description adds value by clarifying url_pattern is a plain substring (not regex), explaining the 'once' parameter's effect, and noting defaults.

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 mocks API responses by intercepting network requests matching a URL substring, specifying customizable status, body, and content-type. It distinguishes from siblings like clear_intercepts and emulate_network.

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

Usage Guidelines5/5

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

Explicit guidance on when to use (forcing error/loading states), ordering (call before triggering action), and cleanup (clear_intercepts). Also documents the 'once' parameter's purpose.

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/segentic-lab/periscope-mcp'

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