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
description: 'Returns full details (headers and body) of a single network request, or a single part if `part` is set. Use the number from browser_network_requests.',
72
+
inputSchema: z.object({
73
+
index: z.number().int().min(1).describe('1-based index of the request, as printed by browser_network_requests.'),
74
+
part: z.enum(REQUEST_PARTS).optional().describe('Return only this part of the request. Omit to return full details.'),
75
+
}),
76
+
type: 'readOnly',
77
+
},
78
+
79
+
handle: async(tab,params,response)=>{
80
+
constallRequests=awaittab.requests();
81
+
constrequest=allRequests[params.index-1];
82
+
if(!request){
83
+
response.addError(`Request #${params.index} not found. Use browser_network_requests to see available indexes.`);
description: 'Show full details (headers, body, response) of a single network request by its number from the `requests` command.',
834
+
category: 'network',
835
+
args: z.object({
836
+
index: numberArg.describe('1-based number of the request as listed by `requests`'),
837
+
}),
838
+
toolName: 'browser_network_request',
839
+
toolParams: ({ index })=>({ index }),
840
+
});
841
+
842
+
constnetworkRequestHeaders=declareCommand({
843
+
name: 'request-headers',
844
+
description: 'Print only the request headers for a single network request by its number from the `requests` command.',
845
+
category: 'network',
846
+
args: z.object({
847
+
index: numberArg.describe('1-based number of the request as listed by `requests`'),
848
+
}),
849
+
toolName: 'browser_network_request',
850
+
toolParams: ({ index })=>({ index,part: 'request-headers'}),
851
+
});
852
+
853
+
constnetworkRequestBody=declareCommand({
854
+
name: 'request-body',
855
+
description: 'Print only the request body for a single network request by its number from the `requests` command.',
856
+
category: 'network',
857
+
args: z.object({
858
+
index: numberArg.describe('1-based number of the request as listed by `requests`'),
859
+
}),
860
+
toolName: 'browser_network_request',
861
+
toolParams: ({ index })=>({ index,part: 'request-body'}),
862
+
});
863
+
864
+
constnetworkResponseHeaders=declareCommand({
865
+
name: 'response-headers',
866
+
description: 'Print only the response headers for a single network request by its number from the `requests` command.',
867
+
category: 'network',
868
+
args: z.object({
869
+
index: numberArg.describe('1-based number of the request as listed by `requests`'),
870
+
}),
871
+
toolName: 'browser_network_request',
872
+
toolParams: ({ index })=>({ index,part: 'response-headers'}),
873
+
});
874
+
875
+
constnetworkResponseBody=declareCommand({
876
+
name: 'response-body',
877
+
description: 'Print the response body for a single network request by its number from the `requests` command. Textual bodies are inlined; binary bodies are saved to a file and the path is printed.',
878
+
category: 'network',
879
+
args: z.object({
880
+
index: numberArg.describe('1-based number of the request as listed by `requests`'),
881
+
}),
882
+
toolName: 'browser_network_request',
883
+
toolParams: ({ index })=>({ index,part: 'response-body'}),
0 commit comments