Skip to main content
Glama
kurdin

GitHub Repos Manager MCP Server

labels.cjs2.35 kB
// src/formatters/labels.cjs function formatListRepoLabelsOutput(labels, owner, repo) { if (!Array.isArray(labels)) { return { content: [ { type: "text", text: `Error: Could not retrieve labels for ${owner}/${repo}.`, }, ], isError: true, }; } const formatted = labels .map( (label) => `**${label.name}** (#${label.color})\n` + `Description: ${label.description || "No description"}\n` + `URL: ${label.url}` ) .join("\n\n"); return { content: [ { type: "text", text: `Found ${labels.length} labels in ${owner}/${repo}:\n\n${ formatted || "No labels found." }`, }, ], }; } function formatCreateLabelOutput(label, owner, repo) { if (!label || typeof label !== "object" || !label.name) { return { content: [ { type: "text", text: `Error: Could not create label in ${owner}/${repo}.`, }, ], isError: true, }; } return { content: [ { type: "text", text: `Created label "${label.name}" in ${owner}/${repo}:\n` + `Color: #${label.color}\n` + `Description: ${label.description || "No description"}\n` + `URL: ${label.url}`, }, ], }; } function formatEditLabelOutput(updatedLabel, owner, repo) { if (!updatedLabel || typeof updatedLabel !== "object" || !updatedLabel.name) { return { content: [ { type: "text", text: `Error: Could not update label in ${owner}/${repo}.`, }, ], isError: true, }; } return { content: [ { type: "text", text: `Updated label "${updatedLabel.name}" in ${owner}/${repo}:\n` + `Color: #${updatedLabel.color}\n` + `Description: ${updatedLabel.description || "No description"}\n` + `URL: ${updatedLabel.url}`, }, ], }; } function formatDeleteLabelOutput(labelName, owner, repo) { return { content: [ { type: "text", text: `Successfully deleted label "${labelName}" from ${owner}/${repo}`, }, ], }; } module.exports = { formatListRepoLabelsOutput, formatCreateLabelOutput, formatEditLabelOutput, formatDeleteLabelOutput, };

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/kurdin/github-repos-manager-mcp'

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