uppercase
Convert text to uppercase for formatting needs. This tool transforms input text into all capital letters.
Instructions
Convert text to uppercase
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | The text to convert to uppercase |
Implementation Reference
- src/index.ts:124-133 (handler)The handler logic for the 'uppercase' tool. It validates the 'text' input as a string and converts it to uppercase using toUpperCase() method.case 'uppercase': const text = validateString(args.text, 'text'); return { content: [ { type: 'text', text: text.toUpperCase(), } as TextContent, ], };
- src/index.ts:44-57 (registration)Registration of the 'uppercase' tool in the tools array used for ListToolsRequestHandler.{ name: 'uppercase', description: 'Convert text to uppercase', inputSchema: { type: 'object', properties: { text: { type: 'string', description: 'The text to convert to uppercase', }, }, required: ['text'], }, },
- src/index.ts:47-56 (schema)Input schema for the 'uppercase' tool defining the required 'text' parameter as a string.inputSchema: { type: 'object', properties: { text: { type: 'string', description: 'The text to convert to uppercase', }, }, required: ['text'], },
- src/index.ts:13-18 (helper)Helper function used in the 'uppercase' handler to validate the input 'text' is a string.const validateString = (value: unknown, fieldName: string): string => { if (typeof value !== 'string') { throw new Error(`${fieldName} must be a string`); } return value; };