Skip to main content
Glama
theburgerllc

AI Development Pipeline MCP

by theburgerllc

write_project_file

Write content to local files within the VS Code workspace directory to manage project files and code during AI-assisted development.

Instructions

Write to a local file in the VS Code workspace (restricted to workspace directory)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
contentYes

Implementation Reference

  • Handler function that validates the file path using validatePath helper and writes the provided content to the file using fs.writeFileSync, returning success or error message.
    async ({ path, content }) => {
      try {
        const safePath = validatePath(path);
        fs.writeFileSync(safePath, content, 'utf8');
        return { content: [{ type: 'text', text: `File written: ${path}` }] };
      } catch (err: any) {
        return { content: [{ type: 'text', text: `File write error: ${err.message}` }] };
      }
    }
  • Input schema using Zod: requires 'path' (string) for the file location and 'content' (string) for the file contents.
    { path: z.string(), content: z.string() },
  • Registers the 'write_project_file' tool on the MCP server with name, description, input schema, and handler function.
    server.tool(
      'write_project_file',
      'Write to a local file in the VS Code workspace (restricted to workspace directory)',
      { path: z.string(), content: z.string() },
      async ({ path, content }) => {
        try {
          const safePath = validatePath(path);
          fs.writeFileSync(safePath, content, 'utf8');
          return { content: [{ type: 'text', text: `File written: ${path}` }] };
        } catch (err: any) {
          return { content: [{ type: 'text', text: `File write error: ${err.message}` }] };
        }
      }
    );
  • Security helper that resolves and validates the file path to ensure it stays within the workspace root, preventing path traversal attacks.
    function validatePath(filePath: string): string {
      const resolvedPath = path.resolve(WORKSPACE_ROOT, filePath);
      if (!resolvedPath.startsWith(WORKSPACE_ROOT)) {
        throw new Error('Path traversal detected - access denied');
      }
      return resolvedPath;
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the restriction to the workspace directory, which adds some context about safety and scope. However, it fails to disclose critical traits such as whether the tool overwrites existing files, requires specific permissions, handles errors, or has any rate limits, leaving significant gaps for a write operation tool.

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 that front-loads the core action ('Write to a local file') and includes essential context ('in the VS Code workspace, restricted to workspace directory') without any wasted words. Every part of the sentence contributes to understanding the tool's purpose and scope.

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 complexity of a file write operation, no annotations, no output schema, and low schema coverage, the description is incomplete. It lacks details on behavior, error handling, return values, and parameter semantics, making it insufficient for safe and effective tool invocation by an AI agent.

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

Parameters2/5

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

The input schema has 2 parameters with 0% description coverage, so the schema provides no semantic information. The description does not add any meaning beyond the schema; it does not explain what 'path' and 'content' represent, their formats, or constraints. This fails to compensate for the low schema coverage, resulting in inadequate parameter documentation.

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 with a specific verb ('Write') and resource ('local file in the VS Code workspace'), and distinguishes it from siblings like 'read_project_file' by specifying the write operation. However, it doesn't explicitly differentiate from other file-related tools like 'check_file_exists' or 'list_directory_files' beyond the write action.

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 context by mentioning 'restricted to workspace directory,' which suggests when to use this tool for workspace file writing. However, it lacks explicit guidance on when to use this versus alternatives like 'run_shell_command' for file operations or prerequisites for safe usage, leaving usage somewhat inferred rather than clearly defined.

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/theburgerllc/ai-development-pipeline-mcp'

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