Where to add logic
- Core Logic: Add your calculation logic to
src/tools/analytics.tsor a new file insrc/tools/. - Tool Registration: Register the MCP tool in
src/index.ts. - Schemas: Use Zod to define strict input schemas for your tool.
Guidelines for Intelligence Tools
If you are adding an “Intelligence” tool (one that performs analysis rather than just returning data):- Be Deterministic: If your tool uses a threshold (like “min impressions”), make it a user-controllable parameter.
- Return Proof: Include the raw metrics that led to the conclusion in the output.
- Use Standard Methodologies: Reference established SEO practices (e.g., Strike Distance is commonly defined as positions 11-20).
- Documentation: Add a dedicated page for your tool in the
docs/tools/directory.