You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This tool provides powerful capabilities to analyze and troubleshoot your Cloudflare Workers through logs and metrics. Here's how to use it effectively:
66
+
67
+
## IMPORTANT: Query Discipline
68
+
69
+
**STOP after the first successful query if it answers the user's question.** Do not run multiple queries unless absolutely necessary. The first query often contains the answer - review it thoroughly before running additional queries.
70
+
71
+
### When to STOP Querying
72
+
- STOP after presenting meaningful results from the first query
73
+
- STOP when you've answered the user's specific question
74
+
- STOP when the user hasn't requested additional exploration
75
+
- Only continue if explicitly directed with "EXPLORE" or similar instruction
Copy file name to clipboardExpand all lines: apps/workers-observability/src/tools/observability.ts
+11-8Lines changed: 11 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -23,6 +23,17 @@ export function registerObservabilityTools(agent: ObservabilityMCP) {
23
23
'query_worker_observability',
24
24
`Query the Workers Observability API to analyze logs and metrics from your Cloudflare Workers.
25
25
26
+
The resulting information should answer the users query. STOP HERE and show them the answer to there question.
27
+
If you can't answer the question ask for a follow up.
28
+
29
+
## Output handling
30
+
31
+
Once you have ran this query you must IMMEDIATELY present the user with this information.
32
+
33
+
- **Events**: Display as a table with key fields. For detailed inspection, show full JSON of individual events.
34
+
- **Calculations**: Use appropriate charts based on the data (bar charts for comparisons, line charts for time series)
35
+
- **Invocations**: Show full request/response details with syntax highlighting for important fields
36
+
26
37
## When to Use This tool
27
38
28
39
- Investigate errors or performance issues in your Cloudflare Workers
@@ -43,17 +54,9 @@ This tool provides three primary views of your Worker data:
43
54
- Before applying filters, use the observability_keys and observability_values tools to confirm available filter fields and the correct filter value to add unless you have the data in a response from a previous query.
44
55
- Common filter fields: $metadata.service, $metadata.trigger, $metadata.message, $metadata.level, $metadata.requestId,
45
56
46
-
## Output handling
47
-
Once you have ran this query you must IMMEDIATELY present the user with this information.
48
-
49
-
- **Events**: Display as a table with key fields. For detailed inspection, show full JSON of individual events.
50
-
- **Calculations**: Use appropriate charts based on the data (bar charts for comparisons, line charts for time series)
51
-
- **Invocations**: Show full request/response details with syntax highlighting for important fields
52
-
53
57
## Troubleshooting
54
58
- If no results are returned, suggest broadening the time range or relaxing filters
55
59
- For errors about invalid fields, recommend using observability_keys to see available options
56
-
- Handle rate limiting by suggesting query optimization
0 commit comments