Skip to main content
Glama

parse_xml

Parse XML data to extract structured information for development workflows, enabling code analysis and web scraping tasks.

Instructions

Parse XML data

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYesXML string to parse

Implementation Reference

  • The handler logic for the 'parse_xml' tool. It dynamically imports xml2js, parses the provided XML string using xml2js.Parser, and returns the parsed result or throws an error if invalid.
    case 'parse_xml': { const xml2js = await import('xml2js'); const data = params.data as string; try { const parser = new xml2js.Parser(); const result = await parser.parseStringPromise(data); return result; } catch (error) { throw new Error(`Invalid XML: ${error instanceof Error ? error.message : String(error)}`); } }
  • Registration of the 'parse_xml' tool in the apiDiscoveryTools array, including its name, description, and input schema.
    { name: 'parse_xml', description: 'Parse XML data', inputSchema: { type: 'object', properties: { data: { type: 'string', description: 'XML string to parse', }, }, required: ['data'], }, },
  • Input schema definition for the 'parse_xml' tool, specifying the 'data' parameter as a required string.
    inputSchema: { type: 'object', properties: { data: { type: 'string', description: 'XML string to parse', }, }, 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