Skip to main content
Glama

approvals

Manage approval requests for spec workflow documents. Request approvals, check status, or delete completed requests through the dashboard interface.

Instructions

Manage approval requests through the dashboard interface.

Instructions

Use this tool to request, check status, or delete approval requests. The action parameter determines the operation:

  • 'request': Create a new approval request after creating each document

  • 'status': Check the current status of an approval request

  • 'delete': Clean up completed, rejected, or needs-revision approval requests (cannot delete pending requests)

CRITICAL: Only provide filePath parameter for requests - the dashboard reads files directly. Never include document content. Wait for user to review and approve before continuing.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesThe action to perform: request, status, or delete
projectPathNoAbsolute path to the project root (optional - uses server context path if not provided)
approvalIdNoThe ID of the approval request (required for status and delete actions)
titleNoBrief title describing what needs approval (required for request action)
filePathNoPath to the file that needs approval, relative to project root (required for request action)
typeNoType of approval request - "document" for content approval, "action" for action approval (required for request)
categoryNoCategory of the approval request - "spec" for specifications, "steering" for steering documents (required for request)
categoryNameNoName of the spec or "steering" for steering documents (required for request)

Implementation Reference

  • Primary handler function for the 'approvals' MCP tool. Dispatches to sub-handlers based on the 'action' parameter (request, status, delete). Includes input validation and type guards.
    export async function approvalsHandler(
      args: {
        action: 'request' | 'status' | 'delete';
        projectPath?: string;
        approvalId?: string;
        title?: string;
        filePath?: string;
        type?: 'document' | 'action';
        category?: 'spec' | 'steering';
        categoryName?: string;
      },
      context: ToolContext
    ): Promise<ToolResponse> {
      // Cast to discriminated union type
      const typedArgs = args as ApprovalArgs;
    
      switch (typedArgs.action) {
        case 'request':
          if (isRequestApproval(typedArgs)) {
            // Validate required fields for request
            if (!args.title || !args.filePath || !args.type || !args.category || !args.categoryName) {
              return {
                success: false,
                message: 'Missing required fields for request action. Required: title, filePath, type, category, categoryName'
              };
            }
            return handleRequestApproval(typedArgs, context);
          }
          break;
        case 'status':
          if (isStatusApproval(typedArgs)) {
            // Validate required fields for status
            if (!args.approvalId) {
              return {
                success: false,
                message: 'Missing required field for status action. Required: approvalId'
              };
            }
            return handleGetApprovalStatus(typedArgs, context);
          }
          break;
        case 'delete':
          if (isDeleteApproval(typedArgs)) {
            // Validate required fields for delete
            if (!args.approvalId) {
              return {
                success: false,
                message: 'Missing required field for delete action. Required: approvalId'
              };
            }
            return handleDeleteApproval(typedArgs, context);
          }
          break;
        default:
          return {
            success: false,
            message: `Unknown action: ${(args as any).action}. Use 'request', 'status', or 'delete'.`
          };
      }
    
      // This should never be reached due to exhaustive type checking
      return {
        success: false,
        message: 'Invalid action configuration'
      };
    }
  • Tool definition including name, description, and detailed inputSchema for validation.
    export const approvalsTool: Tool = {
      name: 'approvals',
      description: `Manage approval requests through the dashboard interface.
    
    # Instructions
    Use this tool to request, check status, or delete approval requests. The action parameter determines the operation:
    - 'request': Create a new approval request after creating each document
    - 'status': Check the current status of an approval request
    - 'delete': Clean up completed, rejected, or needs-revision approval requests (cannot delete pending requests)
    
    CRITICAL: Only provide filePath parameter for requests - the dashboard reads files directly. Never include document content. Wait for user to review and approve before continuing.`,
      inputSchema: {
        type: 'object',
        properties: {
          action: {
            type: 'string',
            enum: ['request', 'status', 'delete'],
            description: 'The action to perform: request, status, or delete'
          },
          projectPath: {
            type: 'string',
            description: 'Absolute path to the project root (optional - uses server context path if not provided)'
          },
          approvalId: {
            type: 'string',
            description: 'The ID of the approval request (required for status and delete actions)'
          },
          title: {
            type: 'string',
            description: 'Brief title describing what needs approval (required for request action)'
          },
          filePath: {
            type: 'string',
            description: 'Path to the file that needs approval, relative to project root (required for request action)'
          },
          type: {
            type: 'string',
            enum: ['document', 'action'],
            description: 'Type of approval request - "document" for content approval, "action" for action approval (required for request)'
          },
          category: {
            type: 'string',
            enum: ['spec', 'steering'],
            description: 'Category of the approval request - "spec" for specifications, "steering" for steering documents (required for request)'
          },
          categoryName: {
            type: 'string',
            description: 'Name of the spec or "steering" for steering documents (required for request)'
          }
        },
        required: ['action']
      }
    };
  • Central tool registration function that includes the 'approvalsTool' in the MCP tools list.
    export function registerTools(): Tool[] {
      return [
        specWorkflowGuideTool,
        steeringGuideTool,
        specStatusTool,
        approvalsTool,
        logImplementationTool
      ];
    }
  • Dispatcher switch case that routes 'approvals' tool calls to the specific approvalsHandler.
    case 'approvals':
      response = await approvalsHandler(args, context);
      break;
  • Utility function for safely translating paths, with defensive checks for module loading issues.
    function safeTranslatePath(path: string): string {
      // Defensive check: ensure translatePath method exists and is callable
      // This handles edge cases where the class might be partially initialized
      if (typeof PathUtils?.translatePath !== 'function') {
        throw new Error(
          `PathUtils.translatePath is not available (got ${typeof PathUtils?.translatePath}). ` +
          'This may indicate a module loading issue. Please reinstall the package with: ' +
          'npm uninstall @pimzino/spec-workflow-mcp && npm install @pimzino/spec-workflow-mcp'
        );
      }
      return PathUtils.translatePath(path);
    }
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden and adds significant behavioral context beyond the schema. It discloses critical constraints: dashboard interface usage, filePath-only parameter for requests (no content), deletion restrictions, and workflow dependencies ('Wait for user to review and approve before continuing'). However, it doesn't mention error handling, rate limits, or authentication requirements.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and well-structured with clear sections. The first sentence states the purpose, followed by usage instructions and critical warnings. Every sentence adds value, though the 'CRITICAL' section could be more concise by integrating with the action descriptions.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (8 parameters, multiple operations) and lack of annotations/output schema, the description provides substantial context about usage patterns, constraints, and workflow integration. It covers the main behavioral aspects but doesn't address potential edge cases, error responses, or the format of status results.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The description adds some value by clarifying action-specific parameter requirements (e.g., 'Only provide filePath parameter for requests', 'approvalId required for status and delete', 'title required for request'), but doesn't provide additional semantic context beyond what's already documented in the schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Manage approval requests through the dashboard interface' and lists specific operations (request, check status, delete). It distinguishes from siblings by focusing on approval management rather than logging, spec status, or workflow guidance. However, it doesn't explicitly contrast with each sibling tool's specific domain.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit usage guidance: 'Use this tool to request, check status, or delete approval requests' with clear action-specific rules. It specifies when to use each action (e.g., 'request' after creating documents, 'delete' for completed/rejected/needs-revision requests) and includes critical exclusions ('cannot delete pending requests', 'Never include document content').

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/Pimzino/spec-workflow-mcp'

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