list_supported_formats
Retrieve a list of supported image formats for conversion, ensuring compatibility before processing with the Image Converter MCP Server.
Instructions
列出支持的图片格式
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:190-197 (registration)Registration of the 'list_supported_formats' tool in the ListToolsRequestSchema handler, defining its name, description, and empty input schema.{ name: 'list_supported_formats', description: '列出支持的图片格式', inputSchema: { type: 'object', properties: {} } }
- src/index.ts:278-288 (handler)The main handler for 'list_supported_formats' tool in the CallToolRequestSchema switch statement. It calls ImageConverter.getSupportedFormats() and returns a formatted text response 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:63-66 (helper)supportedOutputFormats array defining the output formats supported by the converter, used by getSupportedFormats().private supportedOutputFormats = [ 'jpg', 'jpeg', 'png', 'gif', 'bmp', 'tiff', 'webp', 'svg', 'ico', 'avif' ];
- src/converter.ts:58-61 (helper)supportedInputFormats array defining the input formats supported by the converter, used by getSupportedFormats().private supportedInputFormats = [ 'jpg', 'jpeg', 'png', 'gif', 'bmp', 'tiff', 'tif', 'webp', 'svg', 'ico', 'psd', 'heic', 'heif', 'avif' ];
- src/converter.ts:335-340 (helper)The core helper method getSupportedFormats() in ImageConverter class that returns the object with input and output supported formats lists.getSupportedFormats() { return { input: this.supportedInputFormats, output: this.supportedOutputFormats }; }