batch_get_artifacts
Retrieve multiple planning artifacts simultaneously by specifying plan ID and artifact requests to efficiently access structured project data.
Instructions
Get multiple artifacts at once
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| plan_id | Yes | Plan ID | |
| artifact_requests | Yes | List of artifact requests |
Implementation Reference
- src/tools.js:718-752 (handler)The main execution handler for the 'batch_get_artifacts' tool. Loops through artifact_requests, fetches each artifact metadata and content via apiClient, handles errors individually, and returns aggregated results with successes and failures.if (name === "batch_get_artifacts") { const { plan_id, artifact_requests } = args; const results = []; const errors = []; for (const request of artifact_requests) { const { node_id, artifact_id } = request; try { const artifact = await apiClient.artifacts.getArtifact(plan_id, node_id, artifact_id); const content = await apiClient.artifacts.getArtifactContent(plan_id, node_id, artifact_id); results.push({ node_id, artifact_id, success: true, data: { ...artifact, content } }); } catch (error) { errors.push({ node_id, artifact_id, success: false, error: error.message }); } } return formatResponse({ total: artifact_requests.length, successful: results.length, failed: errors.length, results, errors }); }
- src/tools.js:379-397 (schema)Input schema definition for the batch_get_artifacts tool, specifying required plan_id and array of artifact_requests with node_id and artifact_id.inputSchema: { type: "object", properties: { plan_id: { type: "string", description: "Plan ID" }, artifact_requests: { type: "array", description: "List of artifact requests", items: { type: "object", properties: { node_id: { type: "string", description: "Node ID" }, artifact_id: { type: "string", description: "Artifact ID" } }, required: ["node_id", "artifact_id"] } } }, required: ["plan_id", "artifact_requests"] }
- src/tools.js:376-398 (registration)Tool registration in the ListToolsRequestSchema handler's tools array, including name, description, and inputSchema.{ name: "batch_get_artifacts", description: "Get multiple artifacts at once", inputSchema: { type: "object", properties: { plan_id: { type: "string", description: "Plan ID" }, artifact_requests: { type: "array", description: "List of artifact requests", items: { type: "object", properties: { node_id: { type: "string", description: "Node ID" }, artifact_id: { type: "string", description: "Artifact ID" } }, required: ["node_id", "artifact_id"] } } }, required: ["plan_id", "artifact_requests"] } },