/**
* get_version - Version information tool
*
* Returns version, build info, and capabilities of the MCP Domain Checker Price server.
* Use this to verify which version of the MCP server is running.
*/
import { dirname } from 'node:path';
import { fileURLToPath } from 'node:url';
import { createVersionInfo, getPackageJsonPath } from '@3viky/mcp-common';
export async function getVersion() {
try {
const versionInfo = {
...createVersionInfo(import.meta.url),
tools: [
'get_version - Get version and capabilities (safe, read-only)',
'get_domain_pricing - Fetch domain pricing from Joker.com (cached 6h)',
'open_purchase_link - Generate affiliate/regular purchase links',
],
toolMetadata: {
safeToCall: [
'get_version',
'get_domain_pricing',
],
requiresUserApproval: [
'open_purchase_link', // Generates external URLs
],
},
};
return {
content: [
{
type: 'text',
text: JSON.stringify(versionInfo, null, 2),
},
],
};
} catch (error) {
const errorMessage = error instanceof Error ? error.message : String(error);
return {
content: [
{
type: 'text',
text: JSON.stringify({
error: 'Failed to read version information',
details: errorMessage,
}, null, 2),
},
],
};
}
}