// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { maybeFilter } from 'chunkr-ai-mcp/filtering'; import { Metadata, asTextContentResult } from 'chunkr-ai-mcp/tools/types'; import { Tool } from '@modelcontextprotocol/sdk/types.js'; import Chunkr from 'chunkr-ai'; export const metadata: Metadata = { resource: 'file-types', operation: 'read', tags: [], httpMethod: 'get', httpPath: '/file-types', operationId: 'get_supported_file_types', }; export const tool: Tool = { name: 'get_file_types', description: "When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nReturns a list of all file types supported by Chunkr, grouped by category.\nEach category contains a list of formats, where each format includes an extension\npaired with its corresponding MIME type.\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/file_type_get_response',\n $defs: {\n file_type_get_response: {\n type: 'object',\n description: 'All supported file types grouped by category',\n properties: {\n document: {\n type: 'object',\n description: 'Information about supported file formats in a category',\n properties: {\n formats: {\n type: 'array',\n items: {\n type: 'object',\n description: 'A single file type with its extension and mime type',\n properties: {\n extension: {\n type: 'string',\n description: 'The extension of the file type'\n },\n mime_type: {\n type: 'string',\n description: 'The MIME type of the file type'\n }\n },\n required: [ 'extension',\n 'mime_type'\n ]\n }\n }\n },\n required: [ 'formats'\n ]\n },\n image: {\n type: 'object',\n description: 'Information about supported file formats in a category',\n properties: {\n formats: {\n type: 'array',\n items: {\n type: 'object',\n description: 'A single file type with its extension and mime type',\n properties: {\n extension: {\n type: 'string',\n description: 'The extension of the file type'\n },\n mime_type: {\n type: 'string',\n description: 'The MIME type of the file type'\n }\n },\n required: [ 'extension',\n 'mime_type'\n ]\n }\n }\n },\n required: [ 'formats'\n ]\n },\n presentation: {\n type: 'object',\n description: 'Information about supported file formats in a category',\n properties: {\n formats: {\n type: 'array',\n items: {\n type: 'object',\n description: 'A single file type with its extension and mime type',\n properties: {\n extension: {\n type: 'string',\n description: 'The extension of the file type'\n },\n mime_type: {\n type: 'string',\n description: 'The MIME type of the file type'\n }\n },\n required: [ 'extension',\n 'mime_type'\n ]\n }\n }\n },\n required: [ 'formats'\n ]\n },\n spreadsheet: {\n type: 'object',\n description: 'Information about supported file formats in a category',\n properties: {\n formats: {\n type: 'array',\n items: {\n type: 'object',\n description: 'A single file type with its extension and mime type',\n properties: {\n extension: {\n type: 'string',\n description: 'The extension of the file type'\n },\n mime_type: {\n type: 'string',\n description: 'The MIME type of the file type'\n }\n },\n required: [ 'extension',\n 'mime_type'\n ]\n }\n }\n },\n required: [ 'formats'\n ]\n },\n text: {\n type: 'object',\n description: 'Information about supported file formats in a category',\n properties: {\n formats: {\n type: 'array',\n items: {\n type: 'object',\n description: 'A single file type with its extension and mime type',\n properties: {\n extension: {\n type: 'string',\n description: 'The extension of the file type'\n },\n mime_type: {\n type: 'string',\n description: 'The MIME type of the file type'\n }\n },\n required: [ 'extension',\n 'mime_type'\n ]\n }\n }\n },\n required: [ 'formats'\n ]\n }\n },\n required: [ 'document',\n 'image',\n 'presentation',\n 'spreadsheet',\n 'text'\n ]\n }\n }\n}\n```", inputSchema: { type: 'object', properties: { jq_filter: { type: 'string', title: 'jq Filter', description: 'A jq filter to apply to the response to include certain fields. Consult the output schema in the tool description to see the fields that are available.\n\nFor example: to include only the `name` field in every object of a results array, you can provide ".results[].name".\n\nFor more information, see the [jq documentation](https://jqlang.org/manual/).', }, }, required: [], }, annotations: { readOnlyHint: true, }, }; export const handler = async (client: Chunkr, args: Record | undefined) => { const { jq_filter } = args as any; return asTextContentResult(await maybeFilter(jq_filter, await client.fileTypes.get())); }; export default { metadata, tool, handler };