Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .changeset/llms-full-and-sampling-fixes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
"agentimization": minor
"@agentimization/core": minor
---

expand audit coverage and fix page sampling:

- add four llms-full.txt checks (exists, valid structure, size range, links resolve)
- add a dedicated mcp-tool-count check, split out of the mcp server card check
- scope page sampling to the audited path so auditing a sub-path (e.g. /docs) no longer samples unrelated site pages
- expand sitemap indexes to their nested sitemaps so real page URLs are sampled
- make page sampling deterministic so re-runs produce the same score
- fetch sampled pages with an html-only accept header so content-negotiating sites return rendered html instead of the agent markdown variant, fixing false negatives on structured data, open graph, meta description, and link checks
- parallelize the per-page markdown follow-up fetch
64 changes: 62 additions & 2 deletions packages/core/src/checks/agent-protocols.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,65 @@ const mcpServerCard: CheckDefinition = {
},
}

// ─── MCP Tool Count ─────────────────────────────────────

const mcpToolCount: CheckDefinition = {
id: "mcp-tool-count",
name: "MCP Tool Count",
category: "agent-protocols",
description: "Checks that the MCP server card exposes at least one tool",
weight: 0.4,
run: async (ctx) => {
if (!ctx.mcpServerCard) {
return {
id: "mcp-tool-count",
name: "MCP Tool Count",
category: "agent-protocols",
status: "skip",
message: "Skipped: no MCP server card found",
}
}

let card: { tools?: unknown[]; capabilities?: { tools?: unknown[] } }
try {
card = JSON.parse(ctx.mcpServerCard)
} catch {
return {
id: "mcp-tool-count",
name: "MCP Tool Count",
category: "agent-protocols",
status: "skip",
message: "Skipped: MCP server card is invalid JSON",
}
}

const toolCount = Array.isArray(card.tools) ? card.tools.length
: Array.isArray(card.capabilities?.tools) ? card.capabilities.tools.length
: 0

if (toolCount > 0) {
return {
id: "mcp-tool-count",
name: "MCP Tool Count",
category: "agent-protocols",
status: "pass",
message: `MCP server exposes ${toolCount} tool${toolCount === 1 ? "" : "s"}`,
metadata: { toolCount },
}
}

return {
id: "mcp-tool-count",
name: "MCP Tool Count",
category: "agent-protocols",
status: "warn",
message: "MCP server card found but exposes no tools",
suggestion: "List your MCP server's tools in the server card so agents know what actions are available before connecting.",
metadata: { toolCount },
}
},
}

// ─── API Catalog (RFC 9727) ─────────────────────────────

const apiCatalog: CheckDefinition = {
Expand Down Expand Up @@ -148,7 +207,7 @@ const contentSignals: CheckDefinition = {
name: "Content Signals (AI Usage Declarations)",
category: "agent-protocols",
status: "info",
message: "No robots.txt found cannot check for content signals",
message: "No robots.txt found, cannot check for content signals",
suggestion: "Add a robots.txt with Content Signals directives to declare how AI agents may use your content (ai-train, ai-input, search).",
}
}
Expand Down Expand Up @@ -363,7 +422,7 @@ const agentsMd: CheckDefinition = {
category: "agent-protocols",
status: "fail",
message: "No AGENTS.md or AGENT.md found",
suggestion: "Add an AGENTS.md at the project root. This is the universal agent configuration file a README for AI coding agents. Include build/test commands, architecture overview, conventions, and any gotchas. Used by 60k+ open-source projects.",
suggestion: "Add an AGENTS.md at the project root. This is the universal agent configuration file, a README for AI coding agents. Include build/test commands, architecture overview, conventions, and any gotchas. Used by 60k+ open-source projects.",
}
}

Expand Down Expand Up @@ -422,6 +481,7 @@ const agentsMd: CheckDefinition = {

export const agentProtocolChecks: CheckDefinition[] = [
mcpServerCard,
mcpToolCount,
apiCatalog,
contentSignals,
linkHeaders,
Expand Down
Loading
Loading