Skip to content

feat(api): serve an OpenAPI document annotated for AI agents - #13

Merged
albanm merged 12 commits into
masterfrom
feat-agent-api-docs
Oct 14, 2026
Merged

albanm merged 12 commits into
masterfrom
feat-agent-api-docs

Conversation

@albanm

@albanm albanm commented Oct 14, 2026

Copy link
Copy Markdown
Member

Serve an OpenAPI document annotated for AI agents, so @data-fair/openapi-mcp (through data-fair's deployment index) turns the requests aggregation into a metrics_aggregate_requests tool under the read_metrics profile, with a linked metrics-review skill.

  • GET /metrics/api/api-docs.json (public): the document, with x-agent annotations; its agent surface is pinned by a golden (test-it/fixtures/agent-surface.read_metrics.json).
  • GET /metrics/api/agents/skills/<name>.md (public): the skill bodies, from api/contract/skills/.
  • GET /api/daily-api-metrics/_agg gains format=rows (one flat row per group, with a total count and a size limit of 1 to 10000) and the operationTrack / statusClass splits. The default series format is unchanged, covered by new regression tests (test-it/04-agg.ts).
  • The API start now fails when the port is taken instead of waiting forever.
  • Dev: looser simple-directory login rate limiting and departments in the fixtures, for the tests; the pr-ready skill.

Why: agents of a deployment should be able to review the audience of the active account's datasets and applications with the same tools any MCP client gets.

albanm and others added 12 commits October 2, 2026 10:57
GET /metrics/api/api-docs.json is annotated with x-agent for
@data-fair/openapi-mcp: a metrics_aggregate_requests tool (explore
profile) and a metrics-review skill, so agents can review the audience
of the active account's datasets and applications.

_agg accepts format=rows (one flat row per group, with totals and the
number of groups) and size; the default series format is unchanged.
split also accepts operationTrack and statusClass, and an empty split
returns the totals of the period.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Cover the series format with the query shapes the UI sends (splits,
filters, legacy refererCategory, refererApp, account and department
scoping, validation) and check that the rows format gives the same
groups.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
# Conflicts:
#	package-lock.json
#	package.json
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The skill keeps a short description in the API doc and links its body,
served at /metrics/api/agents/skills/metrics-review.md. Needs
@data-fair/openapi-mcp 0.4.0 (linked skills); bump the dependency when
it is released.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…rever

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ocument advertises

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@albanm
albanm merged commit 18a9dec into master Oct 14, 2026
3 checks passed
@albanm
albanm deleted the feat-agent-api-docs branch October 14, 2026 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant