Tools
The tools of the Smarter Project MCP server.
Each tool is a SmarterProjectTool: a name, a description, a Pydantic model of its
arguments, from which its MCP inputSchema is generated, and SmarterProjectTool.run(),
which returns its result as Markdown text for the LLM. Every tool is read-only.
get_repository_overview: what a repository contains, its layout, and its README.search_documentation: ranked passages of the documentation.search_code: ranked files of source code, with their matching lines.read_file: a file, or a range of its lines, with line numbers.list_files: the folders and files under a folder.
A tool works on the repositories of its SmarterProjectScope. The MCP server of
one repository serves the tools without a repository argument, and the MCP server of
all of the repositories adds one, whose values are the repositories’ names.
Note
Experimental. The MCPServer was designed and coded by Claude Code (Anthropic’s Claude Opus 5.5), with Lawrence McDaniel as co-author. It is experimental, and will be documented.
- class smarter.apps.mcpserver.tools.GetRepositoryOverviewTool(scope)[source]
Bases:
SmarterProjectToolWhat a repository contains, how it is laid out, and its README.
- description: ClassVar[str] = 'Describe a repository of The Smarter Project: what it contains, its GitHub url, its indexed commit, its top-level folders and files, and its README. Use it for questions about a repository as a whole, not to answer a specific question, which the search tools answer directly.'
- class smarter.apps.mcpserver.tools.ListFilesTool(scope)[source]
Bases:
SmarterProjectToolList a folder.
- arguments_model
alias of
ListFilesArguments
- description: ClassVar[str] = "List the folders and indexed files in a folder of a repository of The Smarter Project, with the number of files in each folder. Use it to explore a repository's layout."
- entries(index, folder)[source]
Return the folders and files directly in a folder, as Markdown list items.
- Parameters:
index (
RepositoryIndex) – The repository’s index.folder (
str) – The folder, or an empty string for the top level.
- Return type:
- Returns:
The folders, then the files, each sorted by name.
- requires_repository: ClassVar[bool] = True
Whether a call to the MCP server of all of the repositories must name one.
- run(arguments)[source]
Run the tool.
- Parameters:
arguments (
ToolArguments) – The validated arguments, an instance ofarguments_model.- Return type:
- Returns:
The result, as Markdown.
- class smarter.apps.mcpserver.tools.ReadFileTool(scope)[source]
Bases:
SmarterProjectToolRead a file.
- arguments_model
alias of
ReadFileArguments
- description: ClassVar[str] = 'Read a file of a repository of The Smarter Project, with line numbers, from the paths that the search tools and list_files return. Long files are read 400 lines at a time: use start_line and end_line to read more.'
- not_found(index, repository, path)[source]
Return an error message that suggests the files that the LLM may have meant.
- Return type:
- requires_repository: ClassVar[bool] = True
Whether a call to the MCP server of all of the repositories must name one.
- run(arguments)[source]
Run the tool.
- Parameters:
arguments (
ToolArguments) – The validated arguments, an instance ofarguments_model.- Return type:
- Returns:
The result, as Markdown.
- class smarter.apps.mcpserver.tools.SearchCodeTool(scope)[source]
Bases:
SearchToolSearch the source code.
- arguments_model
alias of
SearchCodeArguments
- description: ClassVar[str] = 'Search the source code and configuration of The Smarter Project: Python, TypeScript, Go, YAML manifests, Helm charts, Terraform and more. Returns the best files, with their matching lines and GitHub links. Use it for how something is implemented, and to find a class, function, setting or manifest field by name.'
- run(arguments)[source]
Run the tool.
- Parameters:
arguments (
ToolArguments) – The validated arguments, an instance ofarguments_model.- Return type:
- Returns:
The result, as Markdown.
- class smarter.apps.mcpserver.tools.SearchDocumentationTool(scope)[source]
Bases:
SearchToolSearch the documentation.
- arguments_model
alias of
SearchArguments
- description: ClassVar[str] = 'Search the documentation of The Smarter Project: the Sphinx documentation published at docs.smarter.sh, READMEs, and other reStructuredText and Markdown files. Returns the best passages, with links to the published page and to the source. Use it for concepts, features, configuration, installation and how-to questions.'
- run(arguments)[source]
Run the tool.
- Parameters:
arguments (
ToolArguments) – The validated arguments, an instance ofarguments_model.- Return type:
- Returns:
The result, as Markdown.
- class smarter.apps.mcpserver.tools.SmarterProjectScope(**data)[source]
Bases:
BaseModelThe repositories that one Smarter Project MCP server serves.
- Parameters:
repository – The one repository of the server, or None for all of them.
- model_config = {'frozen': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- repositories: tuple[ProjectRepository, ...]
- repository: ProjectRepository | None
- resolve(name, required)[source]
Return the repository that a tool call names.
- Parameters:
- Return type:
- Returns:
The server’s one repository, the named repository, or None for all of them.
- Raises:
SmarterMCPServerToolError – If the name is not one of the scope’s repositories, or a required name is missing.
- class smarter.apps.mcpserver.tools.SmarterProjectTool(scope)[source]
Bases:
ABCA tool of the Smarter Project MCP server.
- Parameters:
scope (
SmarterProjectScope) – The repositories of the MCP server.
- arguments_model
alias of
ToolArguments
- requires_repository: ClassVar[bool] = False
Whether a call to the MCP server of all of the repositories must name one.
- abstractmethod run(arguments)[source]
Run the tool.
- Parameters:
arguments (
ToolArguments) – The validated arguments, an instance ofarguments_model.- Return type:
- Returns:
The result, as Markdown.
- smarter.apps.mcpserver.tools.TOOL_CLASSES: tuple[type[SmarterProjectTool], ...] = (<class 'smarter.apps.mcpserver.tools.GetRepositoryOverviewTool'>, <class 'smarter.apps.mcpserver.tools.SearchDocumentationTool'>, <class 'smarter.apps.mcpserver.tools.SearchCodeTool'>, <class 'smarter.apps.mcpserver.tools.ReadFileTool'>, <class 'smarter.apps.mcpserver.tools.ListFilesTool'>)
Every tool of the Smarter Project MCP server, in the order that tools/list lists them.
( <class 'smarter.apps.mcpserver.tools.GetRepositoryOverviewTool'>, <class 'smarter.apps.mcpserver.tools.SearchDocumentationTool'>, <class 'smarter.apps.mcpserver.tools.SearchCodeTool'>, <class 'smarter.apps.mcpserver.tools.ReadFileTool'>, <class 'smarter.apps.mcpserver.tools.ListFilesTool'>, )