Skip to main content

:::warning AUTO-GENERATED — do not edit This page is generated from the MCP server snapshot content/backend-mcp.json. Edit the source MCP server (not this file), then run npm run generate. :::

Create ONE endpoint per chart returning only that chart's series

When to use: The frontend needs data for a specific chart/visual.

Prerequisites

  • You know exactly which chart this endpoint feeds and the series it needs.
  • The DB read path is understood (see wire-db-read).

Steps

Step 1: Read the guardrails — one endpoint per chart is a non-negotiable rule.

Tools: get_backend_guardrails

Step 2: List existing endpoints and validate the new per-chart path.

Tools: list_backend_endpoints, validate_backend_endpoint

Step 3: Build the route from the endpoint template, auth-guarded and DB-wired.

Tools: get_endpoint_template, get_auth_pattern, get_db_pattern

Step 4: Return the chart's series in the standard envelope.

Step 5: Run the verify gate.

Tools: validate_backend_endpoint

Full recipe definition

The complete machine-readable recipe as returned by the MCP server:

{
"id": "create-chart-endpoint",
"title": "Create ONE endpoint per chart returning only that chart's series",
"when": "The frontend needs data for a specific chart/visual.",
"prerequisites": [
"You know exactly which chart this endpoint feeds and the series it needs.",
"The DB read path is understood (see wire-db-read)."
],
"steps": [
{
"action": "Read the guardrails — one endpoint per chart is a non-negotiable rule.",
"tools": [
"get_backend_guardrails"
],
"note": "Never batch multiple charts into one response. Each chart gets its own route."
},
{
"action": "List existing endpoints and validate the new per-chart path.",
"tools": [
"list_backend_endpoints",
"validate_backend_endpoint"
],
"note": "Name the route for the chart it serves (e.g. /api/<domain>/<chart>-series)."
},
{
"action": "Build the route from the endpoint template, auth-guarded and DB-wired.",
"tools": [
"get_endpoint_template",
"get_auth_pattern",
"get_db_pattern"
],
"files": [
"src/routes/<domain>_routes.py"
],
"note": "Return ONLY this chart's series in the shape the chart consumes — no unrelated fields."
},
{
"action": "Return the chart's series in the standard envelope.",
"files": [
"src/routes/<domain>_routes.py"
]
},
{
"action": "Run the verify gate.",
"tools": [
"validate_backend_endpoint"
],
"note": "Follow run-verify."
}
],
"filesToCreate": [],
"validation": [
"The route returns exactly one chart's series — nothing else.",
"`validate_backend_endpoint` passes for the per-chart path."
],
"doneCriteria": [
"One endpoint serves exactly one chart.",
"Route is auth-guarded and DB-wired; run-verify passes."
],
"commonMistakes": [
"Batching several charts into a single response (violates one-endpoint-per-chart).",
"Returning extra fields the chart does not consume.",
"Reusing a generic 'dashboard' endpoint for multiple visuals."
],
"relatedRecipes": [
"create-endpoint",
"wire-db-read",
"add-auth-guard",
"add-tests",
"run-verify"
]
}