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
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | XML string to parse |
Implementation Reference
- src/tools/api-discovery.ts:213-223 (handler)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)}`); } }
- src/tools/api-discovery.ts:104-117 (registration)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'], }, },
- src/tools/api-discovery.ts:107-116 (schema)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'], },