get_project_map
Read PROJECT_MAP.md to grasp repo structure, entry points, and ownership early in a session, avoiding costly filesystem scans.
Instructions
Read PROJECT_MAP.md to understand the repo structure.
Call this at session start when structure matters (file layout,
entry points, ownership). Cheaper than scanning the filesystem.Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/projectmem/mcp_server.py:213-223 (handler)Core handler function that reads PROJECT_MAP.md from the .projectmem directory, decorated with @mcp.tool() and @safe_tool. Returns the file contents or a fallback message.
@mcp.tool() @safe_tool def get_project_map() -> str: """Read PROJECT_MAP.md to understand the repo structure. Call this at session start when structure matters (file layout, entry points, ownership). Cheaper than scanning the filesystem.""" path = project_map_path() if path.exists(): return path.read_text(encoding="utf-8") return "No project map found." - src/projectmem/mcp_server.py:213-213 (schema)The tool's type signature — no input parameters, returns a string. Decorated with @mcp.tool() for MCP registration and @safe_tool for exception handling.
@mcp.tool() - src/projectmem/mcp_server.py:213-213 (registration)The @mcp.tool() decorator registers this function as an MCP tool on the FastMCP server instance.
@mcp.tool() - src/projectmem/storage.py:76-77 (helper)Helper function that resolves the path to PROJECT_MAP.md within the .projectmem directory.
def project_map_path(root: Path | None = None) -> Path: return require_mem_dir(root) / PROJECT_MAP_FILE - src/projectmem/storage.py:15-15 (helper)Constant defining the filename for the project map file.
PROJECT_MAP_FILE = "PROJECT_MAP.md"