Skip to main content
Glama

parse_csv

Parse CSV strings into structured data for development workflows. Specify delimiters to handle various CSV formats and extract usable information from raw data.

Instructions

Parse CSV data

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYesCSV string to parse
delimiterNoCSV delimiter,

Implementation Reference

  • The handler function for the 'parse_csv' tool. It parses a CSV string into an array of objects, using the first row as headers and the specified delimiter.
    case 'parse_csv': { const data = params.data as string; const delimiter = (params.delimiter as string) || ','; const lines = data.split('\n'); const headers = lines[0].split(delimiter); const rows = lines.slice(1).map((line) => { const values = line.split(delimiter); const obj: Record<string, string> = {}; headers.forEach((header, index) => { obj[header.trim()] = values[index]?.trim() || ''; }); return obj; }); return rows; }
  • Registration of the 'parse_csv' tool in the apiDiscoveryTools array, including its name, description, and input schema.
    { name: 'parse_csv', description: 'Parse CSV data', inputSchema: { type: 'object', properties: { data: { type: 'string', description: 'CSV string to parse', }, delimiter: { type: 'string', description: 'CSV delimiter', default: ',', }, }, required: ['data'], }, }, {
  • Input schema definition for the 'parse_csv' tool, specifying the expected parameters.
    { name: 'parse_csv', description: 'Parse CSV data', inputSchema: { type: 'object', properties: { data: { type: 'string', description: 'CSV string to parse', }, delimiter: { type: 'string', description: 'CSV delimiter', default: ',', }, }, required: ['data'], }, }, {

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/code-alchemist01/development-tools-mcp-Server'

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