Skip to main content
Glama
he-yang

Excel to JSON MCP by WTSolutions

by he-yang

excel_to_json_mcp_from_url

Convert Excel files from public URLs to JSON format for data integration and processing. Specify output format, headers, and handling options to structure the converted data.

Instructions

Convert Excel (.xlsx) from publicly accessible URL(string format) to JSON. If you do not have a Pro Code, please pass only the url parameter, but not options parameter in the request.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesPublically accessible URL(string format) to Excel file(.xlsx)
optionsNoIf you do not have a Pro Code, please do not pass the options parameter in the request.

Implementation Reference

  • Handler function for the 'excel_to_json_mcp_from_url' tool. It processes the provided URL and options by calling processURLExcel, handles proCode from env if not provided, manages errors by appending documentation URL, sets success message, and returns the result as a JSON string in MCP content format.
    async ({ url, options }) => { if (options && !options.proCode) { options.proCode = process.env.proCode || '' } let result = await processURLExcel(url, options) if (result.isError) { result['data'] = '' result['msg'] = result['msg'] + ' Refer to Documentation at ' + URLs.mcp } else { result['msg'] = 'success' } return { content: [{ type: "text", text: JSON.stringify(result) }] }; }
  • Zod-based input schema defining the required 'url' parameter and optional 'options' object for customizing JSON output formats, headers, delimiters, empty cell handling, boolean formats, overall JSON structure, and proCode.
    inputSchema: { url: z.string().nonempty().describe("Publically accessible URL(string format) to Excel file(.xlsx)"), options: z.object({ jsonMode: z.enum(['nested', 'flat']).optional().describe("Format mode for JSON output: 'nested' or 'flat'"), header: z.enum(['row', 'column']).optional().describe("Specifies which row/column to use as headers: 'row' (first row) or 'column' (first column)"), delimiter: z.enum(['.', '_', '__', '/']).optional().describe("Delimiter character for nested JSON keys when using nested jsonMode: '.', '_', '__', '/'"), emptyCell: z.enum(['emptyString', 'null', 'exclude']).optional().describe("Handling of empty cells: 'emptyString', 'null', or 'exclude'"), booleanFormat: z.enum(['trueFalse', '10', 'string']).optional().describe("Format for boolean values: 'trueFalse', '10', or 'string'"), jsonFormat: z.enum(['arrayOfObject', '2DArray']).optional().describe("Overall JSON output format: 'arrayOfObject' or '2DArray'"), singleObjectFormat: z.enum(['array', 'object']).optional().describe("Format when result has only one object: 'array' (keep as array) or 'object' (return as single object)"), proCode: z.string().optional().describe("Pro Code for Excel to JSON by WTSolutions, if you have one. If you do not have a Pro Code, please do not pass the options parameter in the request."), }).optional().describe("If you do not have a Pro Code, please do not pass the options parameter in the request."), }
  • src/index.ts:49-81 (registration)
    Registration of the 'excel_to_json_mcp_from_url' tool using McpServer.registerTool, including title, description, input schema, and handler function.
    server.registerTool( "excel_to_json_mcp_from_url", { title: "Excel to JSON MCP by WTSolutions - from url", description: "Convert Excel (.xlsx) from publicly accessible URL(string format) to JSON. If you do not have a Pro Code, please pass only the url parameter, but not options parameter in the request.", inputSchema: { url: z.string().nonempty().describe("Publically accessible URL(string format) to Excel file(.xlsx)"), options: z.object({ jsonMode: z.enum(['nested', 'flat']).optional().describe("Format mode for JSON output: 'nested' or 'flat'"), header: z.enum(['row', 'column']).optional().describe("Specifies which row/column to use as headers: 'row' (first row) or 'column' (first column)"), delimiter: z.enum(['.', '_', '__', '/']).optional().describe("Delimiter character for nested JSON keys when using nested jsonMode: '.', '_', '__', '/'"), emptyCell: z.enum(['emptyString', 'null', 'exclude']).optional().describe("Handling of empty cells: 'emptyString', 'null', or 'exclude'"), booleanFormat: z.enum(['trueFalse', '10', 'string']).optional().describe("Format for boolean values: 'trueFalse', '10', or 'string'"), jsonFormat: z.enum(['arrayOfObject', '2DArray']).optional().describe("Overall JSON output format: 'arrayOfObject' or '2DArray'"), singleObjectFormat: z.enum(['array', 'object']).optional().describe("Format when result has only one object: 'array' (keep as array) or 'object' (return as single object)"), proCode: z.string().optional().describe("Pro Code for Excel to JSON by WTSolutions, if you have one. If you do not have a Pro Code, please do not pass the options parameter in the request."), }).optional().describe("If you do not have a Pro Code, please do not pass the options parameter in the request."), } }, async ({ url, options }) => { if (options && !options.proCode) { options.proCode = process.env.proCode || '' } let result = await processURLExcel(url, options) if (result.isError) { result['data'] = '' result['msg'] = result['msg'] + ' Refer to Documentation at ' + URLs.mcp } else { result['msg'] = 'success' } return { content: [{ type: "text", text: JSON.stringify(result) }] }; } );

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/he-yang/excel-to-json-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server