ado_get_attachments
Retrieve attachments from Azure DevOps work items by specifying the work item ID to access linked files and documents.
Instructions
Obtiene la lista de adjuntos de un Work Item
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ID del Work Item |
Implementation Reference
- src/index.ts:874-929 (handler)Handler implementation for 'ado_get_attachments' which fetches work item relations and filters for 'AttachedFile'.
server.tool( "ado_get_attachments", "Obtiene la lista de adjuntos de un Work Item", { id: z.number().describe("ID del Work Item"), }, async ({ id }) => { const api = await getWitApi(); const workItem = await api.getWorkItem( id, undefined, undefined, witInterfaces.WorkItemExpand.Relations ); if (!workItem.relations || workItem.relations.length === 0) { return { content: [ { type: "text", text: `No hay adjuntos en el Work Item #${id}`, }, ], }; } const attachments = workItem.relations .filter((rel) => rel.rel === "AttachedFile") .map((rel) => { const comment = rel.attributes?.comment || ""; const name = rel.attributes?.name || "Sin nombre"; return `- ${name}\n URL: ${rel.url}\n Comentario: ${comment || "(sin comentario)"}`; }); if (attachments.length === 0) { return { content: [ { type: "text", text: `No hay adjuntos en el Work Item #${id}`, }, ], }; } return { content: [ { type: "text", text: `Adjuntos del Work Item #${id}:\n\n${attachments.join("\n\n")}`, }, ], }; } );