Request Body Components — MCP Tools
5 tools in the Request Body Components group of the Routebase MCP server.
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 |
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. 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. 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) |