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
'Queries the Chrome UX Report (CrUX) API to get real-user experience metrics (like Core Web Vitals) for a given URL or origin. You must provide EITHER "origin" OR "url", but not both. You can optionally filter by "formFactor".',
196
+
annotations: {
197
+
category: ToolCategory.PERFORMANCE,
198
+
readOnlyHint: true,
199
+
},
200
+
schema: {
201
+
origin: zod
202
+
.string()
203
+
.describe(
204
+
'The origin to query, e.g., "https://www.google.com". Do not provide this if "url" is specified.',
205
+
)
206
+
.optional(),
207
+
url: zod
208
+
.string()
209
+
.describe(
210
+
'The specific page URL to query, e.g., "https://www.google.com/search?q=puppies". Do not provide this if "origin" is specified.',
211
+
)
212
+
.optional(),
213
+
formFactor: zod
214
+
.enum(['DESKTOP','PHONE','TABLET'])
215
+
.describe(
216
+
'The form factor to filter by. If omitted, data for all form factors is aggregated.',
217
+
)
218
+
.optional(),
219
+
},
220
+
handler: async(request,response)=>{
221
+
const{origin, url, formFactor}=request.params;
222
+
223
+
if((!origin&&!url)||(origin&&url)){
224
+
response.appendResponseLine(
225
+
'Error: you must provide either "origin" or "url", but not both.',
0 commit comments