View as Markdown
Metabase icon

Metabase ACTION

Run Query

Execute a saved question/card and return the results. See the documentation.
  • Action
  • Writes data
  • API key
  • SDK
  • MCP

IMPLEMENTATION

Call this tool

Connect a user's Metabase account once, then configure and run Run Query from your backend or agent.

import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "metabase-run-query",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    metabase: { authProvisionId: "apn_xxxxxxx" },
    cardId: 10,
    ignoreCache: true,
  },
})

console.log(result)

SCHEMA

Inputs

Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.

Run Query inputs
Property Type Description
cardId Card ID integer
The ID of the card (question)
Required Dynamic
ignoreCache Ignore Cache boolean
Whether to ignore the cache and run the query again
Optional
dashboardId Dashboard ID string
The ID of the dashboard
Optional Dynamic
collectionPreview Collection Preview boolean
Whether to return the collection preview
Optional

REFERENCE

Tool details

Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.

Registry key
metabase-run-query
Version
0.0.4
App
Metabase
Authentication
API key
Read-only
No
Destructive
No
Open world
Yes