get_tables
Extract table structures from a specified section of the PDF specification, returning tables with headers, rows, and optional captions.
Instructions
Extract table structures from a specified section of the PDF specification (ISO 32000-2). Returns tables with headers, rows, and optional captions.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| spec | No | Specification ID (e.g., "iso32000-2", "ts32002", "pdfua2"). Use list_specs to see available specs. Default: "iso32000-2" (PDF 2.0). | |
| section | Yes | Section identifier (e.g., "7.3.4", "12.8", "Annex A") | |
| table_index | No | Optional 0-based index to retrieve a specific table. If omitted, returns all tables in the section. |
Implementation Reference
- src/tools/handlers.ts:150-156 (handler)The tool handler function for 'get_tables'. Receives GetTablesArgs, validates inputs (spec, section, table_index), then delegates to the getTables service function.
async function handleGetTables(args: GetTablesArgs) { const specId = validateSpecId(args.spec); validateSectionId(args.section); const tableIndex = validateTableIndex(args.table_index); await ensureRegistryInitialized(); return getTables(args.section, tableIndex, specId); } - src/tools/definitions.ts:146-168 (registration)MCP tool definition (name, description, inputSchema) for 'get_tables'. Registers it with the SDK tool list.
{ name: 'get_tables', description: 'Extract table structures from a specified section of the PDF specification (ISO 32000-2). ' + 'Returns tables with headers, rows, and optional captions.', inputSchema: { type: 'object', properties: { spec: SPEC_PARAM, section: { type: 'string', description: 'Section identifier (e.g., "7.3.4", "12.8", "Annex A")', }, table_index: { type: 'number', description: 'Optional 0-based index to retrieve a specific table. ' + 'If omitted, returns all tables in the section.', }, }, required: ['section'], }, }, - src/tools/handlers.ts:194-203 (registration)Tool handler registry mapping 'get_tables' string to handleGetTables function.
export const toolHandlers = { list_specs: handleListSpecs, get_structure: handleGetStructure, get_section: handleGetSection, search_spec: handleSearchSpec, get_requirements: handleGetRequirements, get_definitions: handleGetDefinitions, get_tables: handleGetTables, compare_versions: handleCompareVersions, } as const;