version
Check the current version of the PDFDancer MCP server to verify software compatibility and ensure access to updated documentation tools.
Instructions
Returns the current version of the pdfdancer-mcp server.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:221-232 (handler)The async handler function for the 'version' tool. It retrieves the version from package.json (via the global 'pkg' variable) and formats it into both text content and structured JSON output for the MCP response.async () => { const version = pkg.version ?? 'unknown'; return { content: [ { type: 'text' as const, text: `pdfdancer-mcp version: ${version}` } ], structuredContent: {version} }; }
- src/index.ts:215-233 (registration)Registers the 'version' tool on the MCP server instance, specifying the tool name, descriptive metadata, and the handler function.server.registerTool( 'version', { title: 'Get server version', description: 'Returns the current version of the pdfdancer-mcp server.' }, async () => { const version = pkg.version ?? 'unknown'; return { content: [ { type: 'text' as const, text: `pdfdancer-mcp version: ${version}` } ], structuredContent: {version} }; } );
- src/index.ts:217-220 (schema)The tool's schema metadata, including human-readable title and description used by MCP clients to understand and invoke the tool. No input parameters are defined.{ title: 'Get server version', description: 'Returns the current version of the pdfdancer-mcp server.' },
- src/index.ts:7-9 (helper)Helper code that dynamically requires the package.json file and prepares the 'pkg' object from which the tool extracts the version string.const require = createRequire(import.meta.url); const packageJson = require('../package.json'); const pkg = packageJson as { version?: string };