Request Body Components — MCP Tools
Reusable request body components. This page documents the Request Body Components group of the Routebase MCP server, with the scope and the parameters of each tool.
A session that stages its tools advertises this group once the agent calls enable_toolset with the slug request-body-components. Full-access keys, scoped keys and OAuth sessions see every tool they are allowed to call without that step.
create_request_body_component
Create a reusable request body component in an API specification. Endpoints link it via set_request_body. Provide either schemaJson (inline JSON Schema) or schemaId (reference to an existing schema) — schemaId wins if both are given. Requires project context.
Required scope: specs:write
| Parameter | Type | Required | Description |
|---|---|---|---|
specId |
string | Yes | Public ID (GUID) of the API specification |
versionId |
string | Yes | Public ID (GUID) of the spec version to add the component to |
name |
string | Yes | Component name as it appears under components/requestBodies (e.g., 'ChangeCandidate') |
required |
boolean | No (default true) |
Whether the request body is required (default true) |
description |
string | No | Description of the request body component |
contentType |
string | No (default "application/json") |
Content type (default 'application/json') |
schemaJson |
string | No | Inline JSON Schema definition as a string |
schemaId |
string | No | Public ID (GUID) of an existing schema to reference (alternative to schemaJson) |
example |
string | No | Example request body |
itemSchemaJson |
string | No | OpenAPI 3.2 only: JSON Schema of one item of a sequential media type (jsonl, json-seq, SSE) |
mediaTypeComponentId |
string | No | OpenAPI 3.2 only: id of a media type component (list_media_type_components) the content entry references via $ref |
serializedExample |
string | No | 3.2 only: example in wire form (serializedValue) |
delete_request_body_component
Delete a request body component (soft delete). Refuses while endpoints still link the component — detach those first with set_request_body(detachRequestBodyComponent: true). Requires project context.
Required scope: specs:delete
| Parameter | Type | Required | Description |
|---|---|---|---|
specId |
string | Yes | Public ID (GUID) of the API specification |
versionId |
string | Yes | Public ID (GUID) of the spec version |
requestBodyComponentId |
string | Yes | Public ID (GUID) of the request body component to delete |
get_request_body_component
Get a request body component including its schema definition (inline schemaJson or a linked schemaId) and its rowVersion for updates. Optionally include usage details showing which endpoints link it. Use this when you already have the component id; to browse them or find an id use list_request_body_components. Requires project context.
Required scope: specs:read
| Parameter | Type | Required | Description |
|---|---|---|---|
specId |
string | Yes | Public ID (GUID) of the API specification |
requestBodyComponentId |
string | Yes | Public ID (GUID) of the request body component |
includeUsage |
boolean | No (default false) |
Include usage details showing which endpoints link this component (default false) |
list_request_body_components
List all reusable request body components (OpenAPI components/requestBodies) of an API specification. Optionally include usage counts showing how many endpoints link each component. Use this to browse or find an id; for one component with its schema use get_request_body_component. Requires project context.
Required scope: specs:read
| Parameter | Type | Required | Description |
|---|---|---|---|
specId |
string | Yes | Public ID (GUID) of the API specification |
versionId |
string | No | Optional version ID (GUID) to filter components by a specific version |
includeUsageCounts |
boolean | No (default false) |
Include usage counts per component (default false, slightly slower) |
update_request_body_component
Update a request body component. This is a full replace: every field not passed is reset, so read the component with get_request_body_component first and send back what should stay. Requires the rowVersion from get_request_body_component for optimistic concurrency control. Requires project context.
Required scope: specs:write
| Parameter | Type | Required | Description |
|---|---|---|---|
specId |
string | Yes | Public ID (GUID) of the API specification |
versionId |
string | Yes | Public ID (GUID) of the spec version |
requestBodyComponentId |
string | Yes | Public ID (GUID) of the request body component to update |
name |
string | Yes | Component name as it appears under components/requestBodies |
rowVersion |
string | Yes | Base64-encoded row version from get_request_body_component (for concurrency control) |
required |
boolean | No (default true) |
Whether the request body is required (default true) |
description |
string | No | Description of the request body component |
contentType |
string | No (default "application/json") |
Content type (default 'application/json') |
schemaJson |
string | No | Inline JSON Schema definition as a string |
schemaId |
string | No | Public ID (GUID) of an existing schema to reference (alternative to schemaJson) |
example |
string | No | Example request body |
isDeprecated |
boolean | No (default false) |
Whether this component is deprecated (default false) |
itemSchemaJson |
string | No | OpenAPI 3.2 only: item schema of a sequential media type; full replace, omitting it clears |
mediaTypeComponentId |
string | No | OpenAPI 3.2 only: id of a media type component the content entry references via $ref; full replace, omitting it detaches |
serializedExample |
string | No | 3.2 only: example in wire form (serializedValue); full replace, omitting clears |