Skip to main content
Glama
backlog-read.ts2.44 kB
import { tool } from "@opencode-ai/plugin"; import { listBacklogItems, formatBacklogAge, isBacklogStale, getBacklogItem } from '../lib/backlog-shared'; import { format } from '../lib/markdown-formatter'; export default tool({ description: "Read-only access to backlog items - list and view backlog work items", args: { topic: tool.schema .string() .optional() .describe("Topic name to fetch a single backlog item with full content"), status: tool.schema .enum(["new", "ready", "review", "done", "reopen", "wontfix"]) .optional() .describe("Filter backlog items by status"), priority: tool.schema .enum(["high", "medium", "low"]) .optional() .describe("Filter backlog items by priority"), showAge: tool.schema .boolean() .optional() .describe("Include age information (default: true)"), }, async execute(args, context) { const { topic, status, priority, showAge = true } = args; // If topic is provided, fetch single item if (topic) { const item = await getBacklogItem(topic); if (!item) { return `Backlog item not found: ${topic}`; } // Return full item details including description const result = { topic: item.topic, priority: item.priority, status: item.status, version: item.version, created: item.created, agent: item.agent, session: item.session, description: item.description, filepath: item.filepath }; if (showAge) { result['age'] = formatBacklogAge(item.created); result['isStale'] = isBacklogStale(item.created); } return JSON.stringify(result, null, 2); } // Otherwise, list items const items = await listBacklogItems(status, priority); if (items.length === 0) { return "No backlog items found"; } // Enhance items with age information const enhancedItems = items.map(item => { if (!showAge) return item; return { ...item, age: formatBacklogAge(item.created), isStale: isBacklogStale(item.created) }; }); const columns = [ { key: 'topic' }, { key: 'priority' }, { key: 'status' }, ]; if (showAge) { columns.push({ key: 'age' }, { key: 'isStale' }); } return format(enhancedItems, { columns }); } });

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/rwese/mcp-backlog'

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