encodeBase64
Convert text or data into Base64 format using this tool in the mcp-helper-tools server. Ideal for encoding inputs securely and efficiently.
Instructions
Encode input data to Base64
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input | Yes | Data to encode |
Implementation Reference
- src/tools/encoding.ts:15-25 (handler)The asynchronous handler function that encodes the input string to Base64 using Node.js Buffer API and returns the result in the standard MCP tool response format.handler: async ({ input }: { input: string }) => { const encoded = Buffer.from(input).toString('base64'); return { content: [ { type: 'text', text: encoded } ] }; }
- src/tools/encoding.ts:5-14 (schema)Defines the input schema for the encodeBase64 tool, requiring an object with a single 'input' property of type string.inputSchema: { type: 'object', properties: { input: { type: 'string', description: 'Data to encode' } }, required: ['input'] },
- src/index.ts:27-33 (registration)Registers encodeBase64 (via encodingTools) into the allTools collection, which is used by the MCP server's ListTools and CallTool request handlers to expose and execute the tool.const allTools: ToolKit = { ...encodingTools, ...geoTools, ...generatorTools, ...dateTimeTools, ...securityTools };