Skip to main content
Glama

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
NameRequiredDescriptionDefault
idYesID del Work Item

Implementation Reference

  • 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")}`,
            },
          ],
        };
      }
    );

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/soulberto/mcp-azure'

If you have feedback or need assistance with the MCP directory API, please join our Discord server