mcp-strawberry
Version:
The crucial MCP tool that finally teaches LLMs how to count 'R's in words like 'strawberry'. Because apparently, they can't do it themselves. Seriously.
37 lines (36 loc) • 1.29 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.CounterRLettersToolController = void 0;
const zod_1 = require("zod");
class CounterRLettersToolController {
server;
counterLetterInWordService;
constructor(server, counterLetterInWordService) {
this.server = server;
this.counterLetterInWordService = counterLetterInWordService;
this.registerTools();
}
registerTools() {
this.registerGetUuidToolhandler();
}
registerGetUuidToolhandler() {
this.server.tool("counter-letters", "Counts the number of letters 'R' in a given word.", {
word: zod_1.z
.string()
.min(1, "The word cannot be empty.")
.refine((word) => !word.includes(" "), "Must contain only one word and no spaces.")
.describe("Word to count the letters"),
}, ({ word }) => {
let data = this.counterLetterInWordService.counterRLetters(word);
return {
content: [
{
type: "text",
text: data,
},
],
};
});
}
}
exports.CounterRLettersToolController = CounterRLettersToolController;