Skip to main content
Glama

set_file_approval

Mark files as approved for development, code review, or QA stages to manage workflow permissions and track changes in coding sessions.

Instructions

Set approval status for a file

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filePathYesPath to the file
approvalTypeYes
approvedByYesWho approved it

Implementation Reference

  • Executes the 'set_file_approval' tool by parsing input arguments and delegating to the MemoryManager's setFileApproval method.
    case 'set_file_approval': {
      const filePath = args.filePath as string;
      const approvalType = args.approvalType as keyof import('./types').ApprovalStatus;
      const approvedBy = args.approvedBy as string;
      await this.memoryManager.setFileApproval(filePath, approvalType, approvedBy);
      return { content: [{ type: 'text', text: 'File approval set successfully' }] };
  • Input schema definition for the 'set_file_approval' tool, defining parameters and validation.
    inputSchema: {
      type: 'object',
      properties: {
        filePath: { type: 'string', description: 'Path to the file' },
        approvalType: { type: 'string', enum: ['devApproved', 'codeReviewApproved', 'qaApproved'] },
        approvedBy: { type: 'string', description: 'Who approved it' }
      },
      required: ['filePath', 'approvalType', 'approvedBy']
    }
  • src/index.ts:603-614 (registration)
    Registers the 'set_file_approval' tool with the MCP server, including name, description, and input schema.
      name: 'set_file_approval',
      description: 'Set approval status for a file',
      inputSchema: {
        type: 'object',
        properties: {
          filePath: { type: 'string', description: 'Path to the file' },
          approvalType: { type: 'string', enum: ['devApproved', 'codeReviewApproved', 'qaApproved'] },
          approvedBy: { type: 'string', description: 'Who approved it' }
        },
        required: ['filePath', 'approvalType', 'approvedBy']
      }
    },
  • Core implementation that updates the approval status for a file in the project memory, handling different approval types via a switch statement.
    async setFileApproval(filePath: string, approvalType: keyof ApprovalStatus, approvedBy: string): Promise<void> {
      const memory = await this.getProjectMemory();
      const relativePath = path.relative(this.projectRoot, filePath);
      
      if (!memory.approvalStates[relativePath]) {
        memory.approvalStates[relativePath] = {};
      }
    
      const approvals = memory.approvalStates[relativePath];
      
      // Set the approval status
      switch (approvalType) {
        case 'devApproved':
          approvals.devApproved = true;
          approvals.devApprovedBy = approvedBy;
          approvals.devApprovedDate = new Date().toISOString();
          break;
        case 'codeReviewApproved':
          approvals.codeReviewApproved = true;
          approvals.codeReviewApprovedBy = approvedBy;
          approvals.codeReviewDate = new Date().toISOString();
          break;
        case 'qaApproved':
          approvals.qaApproved = true;
          approvals.qaApprovedBy = approvedBy;
          approvals.qaApprovedDate = new Date().toISOString();
          break;
      }
    
      await this.saveProjectMemory(memory);
      
      console.log(chalk.green(`✅ ${approvalType} set for ${relativePath} by ${approvedBy}`));
    }
  • TypeScript interface defining the structure of ApprovalStatus used for file approvals.
    export interface ApprovalStatus {
      devApproved?: boolean;
      devApprovedBy?: string;
      devApprovedDate?: string;
      codeReviewApproved?: boolean;
      codeReviewApprovedBy?: string;
      codeReviewDate?: string;
      qaApproved?: boolean;
      qaApprovedBy?: string;
      qaApprovedDate?: string;
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the tool sets approval status, implying a write/mutation operation, but doesn't disclose behavioral traits such as permissions required, whether changes are reversible, side effects, or error handling. This is inadequate for a mutation tool with zero annotation coverage.

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

Conciseness5/5

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

The description is a single, efficient sentence with zero waste. It's appropriately sized and front-loaded, directly stating the tool's purpose without unnecessary elaboration. Every word earns its place, making it highly concise.

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

Completeness2/5

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

Given the tool's complexity (a mutation operation with 3 required parameters), lack of annotations, and no output schema, the description is incomplete. It doesn't cover return values, error conditions, or behavioral context, leaving significant gaps for an AI agent to understand how to invoke it correctly.

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 67% (2 out of 3 parameters have descriptions). The description adds no parameter semantics beyond what the schema provides—it doesn't explain the meaning of 'approvalType' enum values or provide examples. With moderate schema coverage, the baseline is 3 as the description doesn't compensate for gaps.

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

Purpose3/5

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

The description 'Set approval status for a file' clearly states the action (set) and resource (file approval status), but it's vague about what 'approval status' entails and doesn't distinguish from sibling tools like 'get_file_approval_status'. It's not tautological but lacks specificity about the approval mechanism or context.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites, when-not scenarios, or how it relates to sibling tools like 'get_file_approval_status' or 'update_file_metadata'. The description implies usage for setting approvals but offers no contextual boundaries.

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/keleshteri/mcp-memory'

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