cloudflare / cloudflare/mcp-server-cloudflare

Workers Observability: eventType 'workflow' not supported in schema

Open
#362 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
4.2k
Forks
514
Avg merge
1d 21h
Merged PRs (30d)
2

Description

## Problem

When querying Workers Observability logs for Workflow events, the MCP server returns a Zod validation error because `eventType: "workflow"` is not in the allowed enum.

**Error:**
```
Invalid enum value. Expected 'fetch' | 'scheduled' | 'alarm' | 'cron' | 'queue' | 'email' | 'tail' | 'rpc' | 'websocket' | 'unknown', received 'workflow'
```

Additionally, workflow events don't have `cpuTimeMs` and `wallTimeMs` fields that are marked as required in the schema, causing further validation failures.

## Reproduction

Query any workflow-related log via the `query_worker_observability` tool — for example, filtering by `$metadata.requestId` or `$metadata.trigger` that matches a workflow instance ID. The response contains events with `$workers.eventType: "workflow"`, which fails schema validation.

## Expected behavior

The observability schema should include `"workflow"` in the `eventType` enum, and the required fields should account for the different shape of workflow events (no `cpuTimeMs`/`wallTimeMs` at the event level — these are on the workflow metadata instead).

## Environment

- MCP server: `@cloudflare/mcp-server-cloudflare`
- Querying: Workers Observability API
- Worker type: Cloudflare Workflow (`WorkflowEntrypoint`)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.