Skip to main content
Glama
tomjwxf

protect-mcp

write_file

Create or update files by writing content to specified paths, enabling data storage and configuration management within protected environments.

Instructions

Write content to a file

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesFile path to write
contentYesContent to write

Implementation Reference

  • The 'write_file' tool registration in the demo server.
    {
      name: 'write_file',
      description: 'Write content to a file',
      inputSchema: {
        type: 'object',
        properties: {
          path: { type: 'string', description: 'File path to write' },
          content: { type: 'string', description: 'Content to write' },
        },
        required: ['path', 'content'],
      },
    },
  • The handler logic for the 'write_file' tool in the demo server.
    case 'write_file':
      resultText = `[demo] Wrote ${String(args.content || '').length} bytes to ${args.path || '/example.txt'}`;
      break;

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/tomjwxf/scopeblind-gateway'

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