Skip to content

feat: add paginated get_backlinks_profile MCP tool#38

Open
mvanhorn wants to merge 1 commit into
every-app:mainfrom
mvanhorn:fix/36-backlinks-profile-mcp-tool
Open

feat: add paginated get_backlinks_profile MCP tool#38
mvanhorn wants to merge 1 commit into
every-app:mainfrom
mvanhorn:fix/36-backlinks-profile-mcp-tool

Conversation

@mvanhorn

Copy link
Copy Markdown

Summary

Adds a paginated get_backlinks_profile MCP tool that exposes detailed per-link backlink rows (linking URLs, anchors, dofollow/nofollow, authority/spam signals, new/lost/broken status) over MCP. The MCP server previously only exposed get_backlinks_overview (summary + top referring domains), so agentic backlink-analysis workflows had no way to reach the per-row data the web UI already renders.

Why this matters

Issue #36 (labeled status:ready / type:enhancement) asks for exactly this, and the maintainer named the reuse points in the issue. The new tool reuses BacklinksService's paginated row fetching (backlinksServiceData / backlinksApiFilters) instead of re-querying DataForSEO, accepts the existing filter/sort params plus the one_per_domain / as_is modes from src/types/schemas/backlinks.ts, and returns rows in a bounded pagination envelope (page, pageSize, totalCount, hasMore) so a profile is never dumped unbounded. Existing DataForSEO access/credit error messaging is preserved.

Changes

  • New tool src/server/mcp/tools/get-backlinks-profile.ts, modeled on get-backlinks-overview.ts, reusing BacklinksService for row fetching.
  • Registered in src/server/mcp/server.ts; output schema added in src/server/mcp/output-schemas.ts; surfaced in src/client/features/ai-mcp/AvailableTools.tsx.

Testing

Output-schema validation for the new tool added in src/server/mcp/tools/output-schema-validation.test.ts, covering the envelope shape and row schema. Pagination (hasMore / totalCount) and the one_per_domain / as_is modes are exercised.

Closes #36

AI was used for assistance.

Exposes detailed per-link backlink rows over MCP, reusing BacklinksService
paginated row fetching. Closes every-app#36.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add MCP tool for detailed backlink profile rows

1 participant