word_count
Count characters, words, and lines in a block of text to analyze text length and structure.
Instructions
Count characters, words, and lines in a block of text.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes |
Implementation Reference
- The actual handler function for the 'word_count' tool. It counts characters, words, and lines in the input text.
def word_count(text: str) -> dict: """Count characters, words, and lines in a block of text.""" return { "characters": len(text), "words": len(text.split()), "lines": len(text.splitlines()), } - src/friday_mcp_server/tools/utils.py:8-8 (registration)The 'register' function that registers the word_count tool via the @mcp.tool() decorator.
def register(mcp) -> None: - The function signature with type hints: word_count(text: str) -> dict — serves as the schema definition for input (a string) and output (a dict).
def word_count(text: str) -> dict: - src/friday_mcp_server/tools/__init__.py:6-11 (registration)The registration call site where utils.register(mcp) is invoked to register the word_count tool.
def register_all_tools(mcp, *, config, skill_store) -> None: system.register(mcp, config=config) utils.register(mcp) web.register(mcp, config=config) workspace.register(mcp, config=config) skills.register(mcp, skill_store=skill_store)