MULTI-APP TOOLKIT
Build with Better Stack + Grafana
- Multi-app
- One MCP session
- 13 actions
- 0 triggers
- Managed auth
MCP
One MCP session, both toolsets
One session gives your product or agent every Better Stack and Grafana tool at once — connect once, list tools, and call them like any single-app session.
// accessToken: mint a short-lived token with the Connect SDK — see the MCP guide
const transport = new StreamableHTTPClientTransport(
new URL("https://remote.mcp.pipedream.net/v3"),
{
requestInit: {
headers: {
Authorization: `Bearer ${accessToken}`,
"x-pd-project-id": "{project_id}",
"x-pd-environment": "production",
"x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
"x-pd-app-slug": "better_stack,grafana",
},
},
},
)
const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)
const { tools } = await mcp.listTools()
// One list, both toolsets: Better Stack and Grafana tools arrive
// together, each keyed by its own app's slug.
// e.g. run Acknowledge Incident:
const result = await mcp.callTool({
name: "better_stack-acknowledge-incident",
arguments: {
incidentId: "Incident ID",
acknowledgedBy: "Acknowledged By",
},
})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 externalUserId = "{external_user_id}" // any stable ID for this user in your system
const [betterStackTools, grafanaTools] =
await Promise.all([
pd.components.list({ app: "better_stack" }),
pd.components.list({ app: "grafana" }),
])
// One external user owns both connected accounts, so either app's tools
// run on their behalf with the same externalUserId.curl "https://api.pipedream.com/v1/connect/{project_id}/components?app=better_stack" \
-H "X-PD-Environment: production" \
-H "Authorization: Bearer {access_token}"
curl "https://api.pipedream.com/v1/connect/{project_id}/components?app=grafana" \
-H "X-PD-Environment: production" \
-H "Authorization: Bearer {access_token}"
# Connect both accounts to the same external_user_id, then
# configure and invoke either app's tools on that user's behalf.ARCHITECTURE
One user, two connected accounts
Your user connects each account once, under whatever ID they already have in your product. The two stay independent — either can be revoked on its own — and your code reaches both through that one user.
Your product
external_user_id
{external_user_id}Pipedream Connect
Managed identity
Auth · tools · routing
Better Stack
Connected account
Grafana
Connected account
TOOLS
Better Stack tools
The Better Stack tools this pairing puts in reach, each one running on your user's own connected account.
Actions
-
Acknowledge Incident
actionAcknowledges an incident, marking it as acknowledged in Better Stack. See the documentationWritev0.0.2 -
Create Incident
actionInitiates an incident that signals the team. See the documentationWritev0.0.2 -
Resolve Incident
actionBrings a closure to an incident by resolving it with optional resolution details. See the documentationWritev0.0.2
Triggers
No Better Stack triggers are available yet.
TOOLS
Grafana tools
The Grafana tools this pairing puts in reach, each one running on your user's own connected account.
Actions top 8 of 10
-
Create Annotation
actionCreate an annotation on a dashboard or globally. Annotations mark events like deployments, incidents, or configuration changes on dashboard timelines. Use Search Dashboards to find the dashboard UID. OmitdashboardUidfor a global annotation visible on all dashboards. UsetimeandtimeEndfor range annotations (e.g., deployment window).Writev0.0.3 -
Delete Dashboard
actionPermanently delete a Grafana dashboard by UID. This cannot be undone. Use Search Dashboards to find the dashboard UID.Writev0.0.3 -
Get Current User
actionGet the current authenticated Grafana user's identity, including user ID, name, email, organization, and role. Use this to understand the user's permissions and organizational context. The user ID and org context may be needed when creating dashboards or filtering resources.Read-onlyv0.0.3 -
Get Dashboard
actionGet the full dashboard model by UID, including all panels, their queries, variables, and configuration. Use Search Dashboards first to find the dashboard UID. The returned model can be modified and saved back with Save Dashboard.Read-onlyv0.0.3 -
List Alert Rules
actionList all alert rules with their current state (firing, normal, pending, inactive). Returns rule definitions including conditions, labels, and annotations. Use this to answer questions like 'what alerts are firing?' or 'what alerts exist for service X?'Read-onlyv0.0.3 -
List Data Sources
actionList all configured data sources (Prometheus, Loki, InfluxDB, MySQL, etc.), their types, and UIDs. Use the data source UID with Query Data Source to execute queries. Thetypefield indicates what query language to use (e.g.,prometheus→ PromQL,loki→ LogQL,mysql→ SQL).Read-onlyv0.0.3 -
List Folders
actionList all dashboard folders. Folders organize dashboards into logical groups. Use folder UIDs with Search Dashboards to filter by folder, or with Save Dashboard to place a dashboard in a specific folder.Read-onlyv0.0.3 -
Query Data Source
actionExecute a query against any configured data source. Use List Data Sources first to discover available data sources and their UIDs. The query language depends on the data source type:
Prometheus (PromQL):
rate(http_requests_total[5m]),sum by (status_code) (rate(http_requests_total[5m]))Loki (LogQL):
{app="myapp"} |= "error",rate({app="myapp"}[5m])Note: This tool uses the
exprquery field, which works with Prometheus and Loki. For SQL-based data sources (MySQL, Postgres) or InfluxDB, the query field name differs and may not work with this tool.Time range defaults to last 1 hour. Use
fromandtofor custom ranges (supports relative:now-24h,now-7d, or epoch milliseconds).Read-onlyv0.0.3
Triggers
No Grafana triggers are available yet.
MULTI-APP
Works with more apps
The combinations customers connect alongside these two — nothing here is limited to a pair.
REFERENCE
Toolkit details
- x-pd-app-slug
- better_stack,grafana
- Primary app
- Better Stack (better_stack)
- Second app
- Grafana (grafana)
- Authentication
- API key + API key
- Available actions
- 13
- Available triggers
- 0