Skip to content

Commit 3d6fbc9

Browse files
committed
tag wobs api usage as mcp
1 parent a46d68f commit 3d6fbc9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/mcp-common/src/api/workers-observability.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { V4Schema } from '../v4-api'
88

99
import type { z } from 'zod'
1010
import type { zKeysRequest, zQueryRunRequest, zValuesRequest } from '../types/workers-logs-schemas'
11+
import { env } from 'cloudflare:workers'
1112

1213
type QueryRunRequest = z.infer<typeof zQueryRunRequest>
1314

@@ -23,6 +24,8 @@ export async function queryWorkersObservability(
2324
accountId: string,
2425
query: QueryRunRequest
2526
): Promise<z.infer<typeof zReturnedQueryRunResult> | null> {
27+
// @ts-expect-error We don't have actual env in this package
28+
const environment = env.ENVIRONMENT
2629
const data = await fetchCloudflareApi({
2730
endpoint: '/workers/observability/telemetry/query',
2831
accountId,
@@ -32,6 +35,7 @@ export async function queryWorkersObservability(
3235
method: 'POST',
3336
headers: {
3437
'Content-Type': 'application/json',
38+
'workers-observability-origin': `workers-observability-mcp-${environment}`,
3539
},
3640
body: JSON.stringify({ ...query, timeframe: fixTimeframe(query.timeframe) }),
3741
},

0 commit comments

Comments
 (0)