@@ -33,7 +33,8 @@ export const xGetUsageTool: ToolConfig<XGetUsageParams, XGetUsageResponse> = {
3333 request : {
3434 url : ( params ) => {
3535 const queryParams = new URLSearchParams ( {
36- 'usage.fields' : 'cap_reset_day,daily_project_usage,project_cap,project_id,project_usage' ,
36+ 'usage.fields' :
37+ 'cap_reset_day,daily_client_app_usage,daily_project_usage,project_cap,project_id,project_usage' ,
3738 } )
3839
3940 if ( params . days ) {
@@ -63,6 +64,7 @@ export const xGetUsageTool: ToolConfig<XGetUsageParams, XGetUsageResponse> = {
6364 projectCap : null ,
6465 projectUsage : null ,
6566 dailyProjectUsage : [ ] ,
67+ dailyClientAppUsage : [ ] ,
6668 } ,
6769 }
6870 }
@@ -80,6 +82,15 @@ export const xGetUsageTool: ToolConfig<XGetUsageParams, XGetUsageResponse> = {
8082 usage : u . usage ?? 0 ,
8183 } )
8284 ) ,
85+ dailyClientAppUsage : ( data . data . daily_client_app_usage ?? [ ] ) . map (
86+ ( app : { client_app_id : string ; usage : { date : string ; usage : number } [ ] } ) => ( {
87+ clientAppId : String ( app . client_app_id ?? '' ) ,
88+ usage : ( app . usage ?? [ ] ) . map ( ( u : { date : string ; usage : number } ) => ( {
89+ date : u . date ,
90+ usage : u . usage ?? 0 ,
91+ } ) ) ,
92+ } )
93+ ) ,
8394 } ,
8495 }
8596 } ,
@@ -106,7 +117,7 @@ export const xGetUsageTool: ToolConfig<XGetUsageParams, XGetUsageResponse> = {
106117 } ,
107118 dailyProjectUsage : {
108119 type : 'array' ,
109- description : 'Daily usage breakdown' ,
120+ description : 'Daily project usage breakdown' ,
110121 items : {
111122 type : 'object' ,
112123 properties : {
@@ -115,5 +126,26 @@ export const xGetUsageTool: ToolConfig<XGetUsageParams, XGetUsageResponse> = {
115126 } ,
116127 } ,
117128 } ,
129+ dailyClientAppUsage : {
130+ type : 'array' ,
131+ description : 'Daily per-app usage breakdown' ,
132+ items : {
133+ type : 'object' ,
134+ properties : {
135+ clientAppId : { type : 'string' , description : 'Client application ID' } ,
136+ usage : {
137+ type : 'array' ,
138+ description : 'Daily usage entries for this app' ,
139+ items : {
140+ type : 'object' ,
141+ properties : {
142+ date : { type : 'string' , description : 'Usage date in ISO 8601 format' } ,
143+ usage : { type : 'number' , description : 'Number of tweets consumed' } ,
144+ } ,
145+ } ,
146+ } ,
147+ } ,
148+ } ,
149+ } ,
118150 } ,
119151}
0 commit comments