Skip to main content
Glama

APIMock

Create endpoint

create_endpoint

Create a mock HTTP endpoint in a workspace. Provide the workspace slug, method, route (must start with /), and response_body (served as-is; JSON is typical). Pass folder_id to place it in a folder.

Input Schema

NameRequiredDescriptionDefault
routeYesPath starting with /, e.g. /api/v1/users/:id (:param matches one segment).
methodYesHTTP method.
delay_msNoArtificial response delay in ms (default 0).
auth_typeNoSimulated auth scheme shown for the mock (default None).
folder_idNoFolder id to place the endpoint in (from list_folders / create_folder). Omit for the workspace root.
workspaceYesWorkspace slug (from list_workspaces).
capture_modeNoRequest-log capture detail (default metadata).
content_typeNoContent-Type header (default application/json).
require_authNoMake the mock require an Authorization header (default false).
response_bodyYesResponse body served as-is (usually JSON).
cors_allow_allNoSend permissive CORS headers (default true).
selection_modeNoHow a response variant is chosen when several match. first_match (default) serves the first matching variant. weighted picks among matching variants by weight (a percentage); the rest goes to the endpoint's own response.
response_statusNoHTTP status code (default 200).
template_enabledNoInterpret response_body as a response template (default false).
response_variantsNoAlternative responses; replaces the whole list ([] removes them all). Each has a name, status, body and content_type, and optional conditions that must all match: source header | query | path_param | cookie | body (dot path such as customer.email), with operator equals | not_equals | contains | not_contains | starts_with | ends_with | one_of (value is a list) | exists | not_exists | gt | gte | lt | lte | matches (RE2 regex). With no match the endpoint's own response is served. A request can force a variant with the X-APIMock-Variant header. Check the result with simulate_request.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare the mutation/safety profile (readOnlyHint=false, destructiveHint=false), so the bar is lower. The description adds that response_body is served as-is with JSON typical, but omits behavioral context like duplicate-route handling, whether the workspace must exist, or permission requirements.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three short sentences with the purpose and required inputs front-loaded; there is minor redundancy in re-listing required params already in the schema, but nothing is padded or buried.

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?

For a 15-parameter tool with four enums and a complex nested response_variants structure and no output schema, the description covers only the core create path. The schema carries the detail, so it is workable, but the description offers no guidance on variants, delays, auth simulation, or verification.

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 schema already documents all 15 parameters, including defaults and constraints. The description merely restates the required fields and the route '/' constraint, adding no syntax or format meaning beyond what the schema provides.

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?

States a specific verb and resource ('Create a mock HTTP endpoint in a workspace'), which is clearly distinct in kind from sibling resources like create_folder and create_resource. However, it does not differentiate from bulk/import siblings such as scaffold_backend or import_openapi, which also produce endpoints.

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?

It describes the required inputs and how to place the endpoint in a folder, implying usage, but never states when to use create_endpoint versus import_openapi, scaffold_backend, or update_endpoint for modifications. No exclusions or prerequisites are given.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources