@@ -45,15 +45,15 @@ const OPERATION_PARAM_KEYS: Record<string, readonly string[]> = {
4545 instagram_send_text_message : [ 'igUserId' , 'recipientId' , 'message' ] ,
4646 instagram_get_account_insights : [
4747 'igUserId' ,
48- 'metrics ' ,
48+ 'insightMetrics ' ,
4949 'period' ,
5050 'since' ,
5151 'until' ,
5252 'metricType' ,
5353 'breakdown' ,
5454 'timeframe' ,
5555 ] ,
56- instagram_get_media_insights : [ 'mediaId' , 'metrics ' ] ,
56+ instagram_get_media_insights : [ 'mediaId' , 'insightMetrics ' ] ,
5757}
5858
5959const INSTAGRAM_TOOL_IDS = new Set ( Object . keys ( OPERATION_PARAM_KEYS ) )
@@ -64,6 +64,7 @@ const INSTAGRAM_OPERATION_INPUT_KEYS = new Set([
6464 'media' ,
6565 'carouselMedia' ,
6666 ...Object . values ( OPERATION_PARAM_KEYS ) . flat ( ) ,
67+ 'metrics' ,
6768] )
6869
6970const NUMERIC_PARAM_KEYS = new Set ( [ 'limit' , 'thumbOffset' ] )
@@ -479,7 +480,7 @@ export const InstagramBlock: BlockConfig<InstagramResponse> = {
479480 required : { field : 'operation' , value : 'instagram_send_text_message' } ,
480481 } ,
481482 {
482- id : 'metrics ' ,
483+ id : 'insightMetrics ' ,
483484 title : 'Metrics' ,
484485 type : 'short-input' ,
485486 placeholder : 'Comma-separated metrics (e.g. reach,views,likes)' ,
@@ -715,7 +716,9 @@ Return ONLY the timestamp or date - no explanations, no extra text.`,
715716 const value = params [ key ]
716717 if ( value === undefined || value === null || value === '' ) continue
717718
718- if ( NUMERIC_PARAM_KEYS . has ( key ) ) {
719+ if ( key === 'insightMetrics' ) {
720+ result . metrics = value
721+ } else if ( NUMERIC_PARAM_KEYS . has ( key ) ) {
719722 result [ key ] = Number ( value )
720723 } else if ( BOOLEAN_PARAM_KEYS . has ( key ) ) {
721724 result [ key ] = value === true || value === 'true'
@@ -777,7 +780,7 @@ Return ONLY the timestamp or date - no explanations, no extra text.`,
777780 conversationId : { type : 'string' , description : 'DM conversation ID' } ,
778781 messageId : { type : 'string' , description : 'DM message ID' } ,
779782 recipientId : { type : 'string' , description : 'DM recipient Instagram-scoped ID' } ,
780- metrics : { type : 'string' , description : 'Comma-separated insight metrics' } ,
783+ insightMetrics : { type : 'string' , description : 'Comma-separated insight metrics' } ,
781784 period : { type : 'string' , description : 'Account insight period: day or lifetime' } ,
782785 since : { type : 'string' , description : 'Account insights range start' } ,
783786 until : { type : 'string' , description : 'Account insights range end' } ,
0 commit comments