list_supported_formats
Lists all image formats supported for conversion, including JPG, PNG, WebP, GIF, BMP, TIFF, SVG, ICO, and AVIF.
Instructions
列出支持的图片格式
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:278-288 (handler)The MCP tool handler for 'list_supported_formats' that invokes the ImageConverter's getSupportedFormats() method and formats the response as text content listing input and output formats.case 'list_supported_formats': { const formats = this.converter.getSupportedFormats(); return { content: [ { type: 'text', text: `支持的图片格式:\n输入格式:${formats.input.join(', ')}\n输出格式:${formats.output.join(', ')}` } ] }; }
- src/converter.ts:335-340 (helper)Core helper method that returns the object containing arrays of supported input and output image formats.getSupportedFormats() { return { input: this.supportedInputFormats, output: this.supportedOutputFormats }; }
- src/converter.ts:58-66 (helper)Class properties defining the lists of supported input and output image formats used by getSupportedFormats().private supportedInputFormats = [ 'jpg', 'jpeg', 'png', 'gif', 'bmp', 'tiff', 'tif', 'webp', 'svg', 'ico', 'psd', 'heic', 'heif', 'avif' ]; private supportedOutputFormats = [ 'jpg', 'jpeg', 'png', 'gif', 'bmp', 'tiff', 'webp', 'svg', 'ico', 'avif' ];
- src/index.ts:191-197 (registration)Tool registration in the ListTools response, including name, description, and empty input schema (no parameters required).name: 'list_supported_formats', description: '列出支持的图片格式', inputSchema: { type: 'object', properties: {} } }
- src/index.ts:193-196 (schema)Input schema definition for the tool: an empty object since no parameters are needed.inputSchema: { type: 'object', properties: {} }