Skip to main content
Glama

Letter Counter MCP Server

by scaryrawr
letterCounter.test.ts880 B
import { countLetterOccurrences } from "../src/letterCounter"; describe("countLetterOccurrences", () => { it("should return the correct count of a letter in a word", () => { expect(countLetterOccurrences("strawberry", "r")).toBe(3); expect(countLetterOccurrences("banana", "a")).toBe(3); expect(countLetterOccurrences("apple", "p")).toBe(2); }); it("should return 0 if the letter is not in the word", () => { expect(countLetterOccurrences("strawberry", "z")).toBe(0); }); it("should throw an error if the letter is not a single character", () => { expect(() => countLetterOccurrences("strawberry", "rr")).toThrow( "The letter parameter must be a single character." ); }); it("should return the correct count of a letter in a word regardless of case", () => { expect(countLetterOccurrences("stRawbErRy", "r")).toBe(3); }); });

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/scaryrawr/strawberry-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server