Skip to main content
Glama
worldnine
by worldnine

write-text

Write and manage text in Textwell app using three modes: replace, insert, or add content. Integrate via MCP for efficient text operations in your workflow.

Instructions

Write text to Textwell application

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNoreplace: overwrite all, insert: at cursor, add: at endreplace
textYesContent to write to Textwell

Implementation Reference

  • Handler function for the 'write-text' tool. Extracts text and mode from arguments, logs the action, constructs a URL using URL_SCHEMES[mode], encodes the text, and executes it via executeUrlScheme. Returns success message or throws error.
    case 'write-text': {
      const { text, mode = 'replace' } = request.params.arguments as {
        text: string;
        mode?: 'replace' | 'insert' | 'add';
      };
      
      this.server.sendLoggingMessage({
        level: "info",
        data: `Textwell: ${mode} text`
      });
      
      const encodedText = encodeURIComponent(text);
      const url = `${URL_SCHEMES[mode]}?text=${encodedText}`;
      
      try {
        await this.executeUrlScheme(url);
        return {
          content: [{
            type: 'text',
            text: `Text ${mode} completed`
          }]
        };
      } catch (error) {
        throw new McpError(
          ErrorCode.InternalError,
          `Textwell write failed: ${error instanceof Error ? error.message : 'Unknown error'}`
        );
      }
    }
  • Input schema definition for the 'write-text' tool, including required 'text' parameter and optional 'mode' with enum values.
    inputSchema: {
      type: 'object',
      properties: {
        text: {
          type: 'string',
          description: 'Content to write to Textwell'
        },
        mode: {
          type: 'string',
          enum: ['replace', 'insert', 'add'],
          description: 'replace: overwrite all, insert: at cursor, add: at end',
          default: 'replace'
        }
      },
      required: ['text']
    }
  • src/server.ts:63-83 (registration)
    Registration of the 'write-text' tool in the ListToolsRequestSchema handler, providing name, description, and input schema.
      {
        name: 'write-text',
        description: 'Write text to Textwell application',
        inputSchema: {
          type: 'object',
          properties: {
            text: {
              type: 'string',
              description: 'Content to write to Textwell'
            },
            mode: {
              type: 'string',
              enum: ['replace', 'insert', 'add'],
              description: 'replace: overwrite all, insert: at cursor, add: at end',
              default: 'replace'
            }
          },
          required: ['text']
        }
      }
    ]
Install Server

Other Tools

Related 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/worldnine/textwell-mcp'

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