Skip to main content
Glama
ConnorBoetig-dev

Unrestricted Development MCP Server

fs_append_file

Add content to the end of a file or create a new file if it doesn't exist, supporting various encoding formats for development workflows.

Instructions

Append content to an existing file. Creates the file if it doesn't exist.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute or relative path to the file
contentYesContent to append to the file
encodingNoFile encodingutf8

Implementation Reference

  • Core handler function that appends content to a file using Node.js fs.appendFile, handles errors, and returns JSON response.
    export async function appendFile(args: z.infer<typeof appendFileSchema>): Promise<ToolResponse> {
      try {
        await fs.appendFile(args.path, args.content, args.encoding as BufferEncoding);
    
        return {
          content: [
            {
              type: "text" as const,
              text: JSON.stringify({
                success: true,
                path: args.path,
                bytesAppended: args.content.length
              }, null, 2)
            }
          ]
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text" as const,
              text: JSON.stringify({
                success: false,
                error: error instanceof Error ? error.message : String(error)
              }, null, 2)
            }
          ],
          isError: true
        };
      }
    }
  • Zod input schema for validating tool arguments: path, content, encoding.
    export const appendFileSchema = z.object({
      path: z.string().describe('Absolute or relative path to the file'),
      content: z.string().describe('Content to append to the file'),
      encoding: z.enum(['utf8', 'binary', 'base64']).default('utf8').describe('File encoding')
    });
  • MCP tool registration in filesystemTools array, defining name, description, and inputSchema for the MCP protocol.
    {
      name: 'fs_append_file',
      description: 'Append content to an existing file. Creates the file if it doesn\'t exist.',
      inputSchema: {
        type: 'object',
        properties: {
          path: {
            type: 'string',
            description: 'Absolute or relative path to the file'
          },
          content: {
            type: 'string',
            description: 'Content to append to the file'
          },
          encoding: {
            type: 'string',
            enum: ['utf8', 'binary', 'base64'],
            default: 'utf8',
            description: 'File encoding'
          }
        },
        required: ['path', 'content']
      }
    },
  • src/index.ts:313-315 (registration)
    Dispatch logic in main server CallToolRequestHandler that parses arguments and invokes the appendFile handler.
    if (name === 'fs_append_file') {
      const validated = appendFileSchema.parse(args);
      return await appendFile(validated);
Behavior2/5

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

With no annotations, the description carries full burden. It mentions the creation fallback behavior, but doesn't disclose permissions needed, whether appending is atomic, how encoding affects content, error handling, or what happens on success/failure. For a file mutation tool, this leaves significant behavioral gaps.

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?

Two concise sentences that directly state the tool's core functionality and edge-case behavior. No wasted words, perfectly front-loaded with the primary purpose.

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

Completeness3/5

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

For a file mutation tool with no annotations and no output schema, the description covers the basic operation but lacks details about permissions, error responses, encoding implications, and success criteria. It's minimally adequate but leaves important contextual gaps.

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%, providing clear documentation for all parameters. The description doesn't add any parameter-specific details beyond what the schema already states, so it meets the baseline for high schema coverage.

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

Purpose5/5

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

The description clearly states the verb ('Append content') and resource ('to an existing file'), with the additional nuance of creating the file if it doesn't exist. This distinguishes it from sibling tools like fs_write_file (which presumably overwrites) and fs_read_file (which only reads).

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

Usage Guidelines3/5

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

The description implies usage for file content addition with fallback creation, but doesn't explicitly state when to use this vs. alternatives like fs_write_file. No guidance on prerequisites, error conditions, or exclusions is provided.

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/ConnorBoetig-dev/mcp2'

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