get_project_descendants
Retrieve descendant projects from a WebSim project to explore related content and hierarchical relationships within the platform.
Instructions
Get projects that are descendants of a WebSim project
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | WebSim project ID | |
| limit | No | Number of descendants to return (default: 20) | |
| offset | No | Number of descendants to skip (default: 0) |
Input Schema (JSON Schema)
{
"properties": {
"limit": {
"default": 20,
"description": "Number of descendants to return (default: 20)",
"type": "number"
},
"offset": {
"default": 0,
"description": "Number of descendants to skip (default: 0)",
"type": "number"
},
"project_id": {
"description": "WebSim project ID",
"type": "string"
}
},
"required": [
"project_id"
],
"type": "object"
}
Implementation Reference
- server.js:459-471 (handler)MCP tool handler for 'get_project_descendants'. Validates input with ProjectIdSchema, fetches descendants using apiClient, formats and returns JSON response.handler: async (args) => { const { project_id, limit = 20, offset = 0 } = ProjectIdSchema.parse(args); const result = await apiClient.getProjectDescendants(project_id, limit, offset); return { content: [{ type: "text", text: JSON.stringify({ success: true, data: result, message: `Successfully retrieved ${result.items?.length || 0} descendants for project ${project_id}` }, null, 2) }] };
- server.js:439-457 (schema)Input schema defining parameters for get_project_descendants tool: project_id (required), optional limit and offset.inputSchema: { type: "object", properties: { project_id: { type: "string", description: "WebSim project ID" }, limit: { type: "number", description: "Number of descendants to return (default: 20)", default: 20 }, offset: { type: "number", description: "Number of descendants to skip (default: 0)", default: 0 } }, required: ["project_id"]
- server.js:436-472 (registration)Full tool registration in the tools array, including name, description, inputSchema, and handler reference for get_project_descendants.{ name: "get_project_descendants", description: "Get projects that are descendants of a WebSim project", inputSchema: { type: "object", properties: { project_id: { type: "string", description: "WebSim project ID" }, limit: { type: "number", description: "Number of descendants to return (default: 20)", default: 20 }, offset: { type: "number", description: "Number of descendants to skip (default: 0)", default: 0 } }, required: ["project_id"] }, handler: async (args) => { const { project_id, limit = 20, offset = 0 } = ProjectIdSchema.parse(args); const result = await apiClient.getProjectDescendants(project_id, limit, offset); return { content: [{ type: "text", text: JSON.stringify({ success: true, data: result, message: `Successfully retrieved ${result.items?.length || 0} descendants for project ${project_id}` }, null, 2) }] }; }
- server.js:131-134 (helper)Core API helper method in WebSimAPIClient that constructs and executes the HTTP request to fetch project descendants with pagination.async getProjectDescendants(projectId, limit = 20, offset = 0) { const params = new URLSearchParams({ limit: limit.toString(), offset: offset.toString() }); return this.makeRequest(`/api/v1/projects/${projectId}/descendants?${params}`); }
- server.js:23-25 (schema)Shared Zod validation schema used by get_project_descendants handler (and others) to parse and validate the project_id parameter.const ProjectIdSchema = z.object({ project_id: z.string().describe('WebSim project ID') });