create_api
Creates a new API by specifying its name, summary, description, and target workspace ID.
Instructions
Create a new API
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | API name | |
| summary | No | Brief description | |
| description | No | Detailed description (supports Markdown) | |
| workspaceId | Yes | Target workspace ID |
Implementation Reference
- src/tools/api/apis/index.ts:130-136 (handler)The handler function that executes the 'create_api' tool logic. Validates that name and workspaceId are provided, then sends a POST request to /apis with the data.
async createApi(data: any): Promise<ToolCallResponse> { if (!data.name || !data.workspaceId) { throw new McpError(ErrorCode.InvalidParams, 'name and workspaceId are required'); } const response = await this.client.post('/apis', data); return this.createResponse(response.data); } - The tool registration (schema definition) for 'create_api', defining its inputSchema with optional fields 'name', 'summary', 'description', and 'workspaceId', with required fields 'name' and 'workspaceId'.
{ name: 'create_api', description: 'Create a new API', inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'API name', }, summary: { type: 'string', description: 'Brief description', }, description: { type: 'string', description: 'Detailed description (supports Markdown)', }, workspaceId: { type: 'string', description: 'Target workspace ID', }, }, required: ['name', 'workspaceId'], }, }, - src/tools/api/apis/index.ts:43-44 (registration)The dispatch case in handleToolCall that routes the 'create_api' tool name to the createApi handler method.
case 'create_api': return await this.createApi(args); - src/types/apis.ts:37-42 (helper)TypeScript interface defining the shape of the CreateApiRequest, including name, workspaceId, summary, and description fields.
export interface CreateApiRequest { name: string; workspaceId: string; summary?: string; description?: string; }