Skip to main content
Glama
he-yang

JSON to Excel MCP by WTSolutions

by he-yang

json_to_excel_mcp_from_data

Convert JSON data to CSV format for spreadsheet analysis. Specify formatting options like nested mode, delimiters, and depth levels to structure your data.

Instructions

Convert JSON data to CSV data. If you do not have a Pro Code, please pass only the data parameter, and do not pass the options parameter.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYesJSON data to be converted to CSV
optionsNoIf you do not have a Pro Code, please do not pass the options parameter in the request.

Implementation Reference

  • src/index.ts:43-72 (registration)
    Full registration of the 'json_to_excel_mcp_from_data' MCP tool, including metadata, Zod input schema, and inline handler function that delegates to processDataJ2E.
    server.registerTool( "json_to_excel_mcp_from_data", { title: "JSON to Excel MCP by WTSolutions - from data", description: "Convert JSON data to CSV data. If you do not have a Pro Code, please pass only the data parameter, and do not pass the options parameter.", inputSchema: { data: z.string().nonempty().describe("JSON data to be converted to CSV"), options: z.object({ jsonMode: z.enum(['nested', 'flat']).optional().describe("Format mode for JSON output: “nested”, or “flat”"), delimiter: z.enum(['.', '_', '__', '/']).optional().describe("Delimiter character for nested JSON keys when using jsonMode: “nested”, acceptable delimiters are “.”, “_”, “__”, “/”."), maxDepth: z.enum(['unlimited', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20']).optional().describe("Maximum depth for nested JSON objects when using jsonMode: “nested”. For maxDepth, “unlimited”, “1” ~ “20” acceptable."), proCode: z.string().optional().describe("Pro Code for JSON to Excel MCP by WTSolutions. If you do not have a Pro Code, please do not pass this parameter."), }).optional().describe("If you do not have a Pro Code, please do not pass the options parameter in the request."), } }, async ({ data, options }) => { if (options && !options.proCode) { options.proCode = process.env.proCode || '' } let result = await processDataJ2E(data, options) if (result.isError) { result['data'] = '' result['msg'] = result['msg'] + ' ||| Refer to Documentation at ' + URLs.mcpJ2E } else { result['msg'] = 'success' } return { content: [{ type: "text", text: JSON.stringify(result) }] }; } );
  • The core handler function for the tool. It sets proCode from environment if not provided, calls processDataJ2E with data and options, handles errors by modifying result and appending documentation URL, sets success message, and returns the result as JSON text content.
    async ({ data, options }) => { if (options && !options.proCode) { options.proCode = process.env.proCode || '' } let result = await processDataJ2E(data, options) if (result.isError) { result['data'] = '' result['msg'] = result['msg'] + ' ||| Refer to Documentation at ' + URLs.mcpJ2E } else { result['msg'] = 'success' } return { content: [{ type: "text", text: JSON.stringify(result) }] }; }
  • Zod-based input schema for the tool, validating 'data' as non-empty string and optional 'options' object with fields for jsonMode, delimiter, maxDepth, and proCode.
    inputSchema: { data: z.string().nonempty().describe("JSON data to be converted to CSV"), options: z.object({ jsonMode: z.enum(['nested', 'flat']).optional().describe("Format mode for JSON output: “nested”, or “flat”"), delimiter: z.enum(['.', '_', '__', '/']).optional().describe("Delimiter character for nested JSON keys when using jsonMode: “nested”, acceptable delimiters are “.”, “_”, “__”, “/”."), maxDepth: z.enum(['unlimited', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20']).optional().describe("Maximum depth for nested JSON objects when using jsonMode: “nested”. For maxDepth, “unlimited”, “1” ~ “20” acceptable."), proCode: z.string().optional().describe("Pro Code for JSON to Excel MCP by WTSolutions. If you do not have a Pro Code, please do not pass this parameter."), }).optional().describe("If you do not have a Pro Code, please do not pass the options parameter in the request."), }
  • Import statement for processDataJ2E function (core conversion logic) and URLs, used by the tool handler. Note: './functions.js' could not be resolved in the codebase.
    import { processDataJ2E, processURLJ2E, URLs } from './functions.js'

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/json-to-excel-mcp'

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