@@ -23,9 +23,9 @@ export const takeHeapSnapshot = definePageTool({
2323 . describe ( 'A path to a .heapsnapshot file to save the heapsnapshot to.' ) ,
2424 } ,
2525 blockedByDialog : true ,
26- handler : async ( request , response , context ) => {
26+ verifyFilesSchema : [ 'filePath' ] ,
27+ handler : async ( request , response ) => {
2728 const page = request . page ;
28- await context . validatePath ( request . params . filePath ) ;
2929
3030 await page . pptrPage . captureHeapSnapshot ( {
3131 path : ensureExtension ( request . params . filePath , '.heapsnapshot' ) ,
@@ -50,8 +50,8 @@ export const getHeapSnapshotSummary = defineTool({
5050 filePath : zod . string ( ) . describe ( 'A path to a .heapsnapshot file to read.' ) ,
5151 } ,
5252 blockedByDialog : false ,
53+ verifyFilesSchema : [ 'filePath' ] ,
5354 handler : async ( request , response , context ) => {
54- await context . validatePath ( request . params . filePath ) ;
5555 const stats = await context . getHeapSnapshotStats ( request . params . filePath ) ;
5656 const staticData = await context . getHeapSnapshotStaticData (
5757 request . params . filePath ,
@@ -82,8 +82,8 @@ export const getHeapSnapshotDetails = defineTool({
8282 . describe ( 'The page size for pagination of aggregates.' ) ,
8383 } ,
8484 blockedByDialog : false ,
85+ verifyFilesSchema : [ 'filePath' ] ,
8586 handler : async ( request , response , context ) => {
86- await context . validatePath ( request . params . filePath ) ;
8787 const aggregates = await context . getHeapSnapshotAggregates (
8888 request . params . filePath ,
8989 ) ;
@@ -111,8 +111,8 @@ export const getHeapSnapshotClassNodes = defineTool({
111111 pageSize : zod . number ( ) . optional ( ) . describe ( 'The page size for pagination.' ) ,
112112 } ,
113113 blockedByDialog : false ,
114+ verifyFilesSchema : [ 'filePath' ] ,
114115 handler : async ( request , response , context ) => {
115- await context . validatePath ( request . params . filePath ) ;
116116 const nodes = await context . getHeapSnapshotNodesById (
117117 request . params . filePath ,
118118 request . params . id ,
@@ -135,15 +135,14 @@ export const getHeapSnapshotRetainers = defineTool({
135135 conditions : [ 'experimentalMemory' ] ,
136136 } ,
137137 blockedByDialog : false ,
138+ verifyFilesSchema : [ 'filePath' ] ,
138139 schema : {
139140 filePath : zod . string ( ) . describe ( 'A path to a .heapsnapshot file to read.' ) ,
140141 nodeId : zod . number ( ) . describe ( 'The node ID to get retainers for.' ) ,
141142 pageIdx : zod . number ( ) . optional ( ) . describe ( 'The page index for pagination.' ) ,
142143 pageSize : zod . number ( ) . optional ( ) . describe ( 'The page size for pagination.' ) ,
143144 } ,
144145 handler : async ( request , response , context ) => {
145- await context . validatePath ( request . params . filePath ) ;
146-
147146 const retainers = await context . getHeapSnapshotRetainers (
148147 request . params . filePath ,
149148 request . params . nodeId ,
0 commit comments