Adding New Tools
Adding New Tools
Define Tool in Source
// In appropriate file (e.g., zetrix-client.ts)
server.setRequestHandler(CallToolRequestSchema, async (request) => {
if (request.params.name === "zetrix_new_tool") {
const { param1 } = request.params.arguments as { param1: string };
try {
const result = await yourFunction(param1);
return {
content: [{
type: "text",
text: JSON.stringify(result, null, 2)
}]
};
} catch (error) {
return {
content: [{
type: "text",
text: `Error: ${error.message}`
}],
isError: true
};
}
}
});Register Tool
Add Tests
Update Documentation
Add to README.md
Update docs/EXAMPLES.md
Include in this GITDOC
Submit Pull Request
Clear description
Tests included
Documentation updated
Code Guidelines
Last updated