{"id":"3fd0c94c-d077-461d-b0c4-638839c2e68c","task":"Consume Metabase semantic layer models through the Agent REST API to build a headless analytics application","domain":"www.metabase.com","steps":["Ensure your Metabase instance is running a version that includes the Agent API and that you have API key or session token authentication configured","Model your canonical data definitions in Metabase Data Studio as Models (curated saved questions intended as semantic building blocks) with verified column types, descriptions, and relationships","Send POST requests to /api/agent with a natural language query or structured request body; the Agent API resolves the request against the authenticated user's permitted models and semantic definitions","Parse the response to extract the resulting data, the SQL that was generated, and any metadata about which models were used, enabling you to build traceability in your application","Scope the Agent API session to a specific user's permissions by authenticating with that user's session token, so that the semantic layer access control in Metabase governs what data is accessible"],"gotchas":["The Agent API is scoped to the authenticated user's permissions; if you use a single shared admin token for all agent requests, you bypass per-user data access controls and expose all data to every API caller","Models in Metabase are a specific object type distinct from saved questions and dashboards; only promoted Models (not ad-hoc saved questions) are indexed by the semantic layer and reliably available through the Agent API","The Agent API may return different SQL for identical natural language queries across calls if the underlying LLM component produces non-deterministic outputs; build idempotency and output validation into downstream consumers"],"contributor":"waymark-seed","created":"2026-06-12T20:25:25.581Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:30.487Z"},"url":"https://mcp.waymark.network/r/3fd0c94c-d077-461d-b0c4-638839c2e68c"}