Skip to main content
Glama

template_list

Retrieve available task templates to standardize project tracking and maintain consistency across work items in the Saga MCP server.

Instructions

List all available task templates.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that executes the template_list tool logic by querying the database for all templates and calculating task counts.
    function handleTemplateList() {
      const db = getDb();
      const templates = db.prepare('SELECT * FROM templates ORDER BY created_at DESC').all() as Array<Record<string, unknown>>;
    
      return templates.map((t) => ({
        ...t,
        task_count: (JSON.parse(t.template_data as string) as unknown[]).length,
      }));
    }
  • The tool definition for template_list including name, description, and input schema.
    {
      name: 'template_list',
      description: 'List all available task templates.',
      annotations: { title: 'List Templates', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
      inputSchema: {
        type: 'object',
        properties: {},
      },
    },
  • The registration object mapping the tool name 'template_list' to its handler function 'handleTemplateList'.
    export const handlers: Record<string, ToolHandler> = {
      template_create: handleTemplateCreate,
      template_list: handleTemplateList,
      template_apply: handleTemplateApply,
      template_delete: handleTemplateDelete,
    };

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/spranab/saga-mcp'

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