File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -295,12 +295,13 @@ const handleMCPResponse = async (client: Client) => {
295295} ;
296296export const swrMCPMetadata = (
297297 mcpServer : Pick < Integration , "connection" | "name" > ,
298+ ignoreCache = false ,
298299) => {
299300 const fetch = async ( ) => {
300301 const client = await createServerClient ( mcpServer ) ;
301302 return handleMCPResponse ( client ) . finally ( ( ) => client . close ( ) ) ;
302303 } ;
303- if ( "url" in mcpServer . connection ) {
304+ if ( "url" in mcpServer . connection && ! ignoreCache ) {
304305 return swr . cache ( fetch , mcpServer . connection . url ) ;
305306 }
306307 return fetch ( ) ;
@@ -309,6 +310,7 @@ export const swrMCPMetadata = (
309310export async function listToolsByConnectionType (
310311 connection : MCPConnection ,
311312 ctx : AppContext ,
313+ ignoreCache = false ,
312314) {
313315 switch ( connection . type ) {
314316 case "INNATE" : {
@@ -347,7 +349,7 @@ export async function listToolsByConnectionType(
347349 return await swrMCPMetadata ( {
348350 name : connection . type ,
349351 connection,
350- } ) ;
352+ } , ignoreCache ) ;
351353 }
352354 default : {
353355 return { error : "Invalid connection type" } ;
Original file line number Diff line number Diff line change 11{
22 "name" : " @deco/cli" ,
3- "version" : " 0.9.7 " ,
3+ "version" : " 0.9.8 " ,
44 "description" : " A CLI for interacting with deco.chat." ,
55 "license" : " MIT" ,
66 "exports" : " ./cli.ts" ,
Original file line number Diff line number Diff line change @@ -172,7 +172,12 @@ export const genEnv = async (
172172 ...bindings ,
173173 ...DEFAULT_BINDINGS ,
174174 ...selfUrl
175- ? [ { name : "SELF" , type : "mcp" , integration_url : selfUrl } ]
175+ ? [ {
176+ name : "SELF" ,
177+ type : "mcp" ,
178+ integration_url : selfUrl ,
179+ ignoreCache : true ,
180+ } ]
176181 : [ ] ,
177182 ] . map ( async ( binding ) => {
178183 let connection : unknown ;
@@ -207,6 +212,9 @@ export const genEnv = async (
207212 name : "INTEGRATIONS_LIST_TOOLS" ,
208213 arguments : {
209214 connection,
215+ ignoreCache : "ignoreCache" in binding
216+ ? binding . ignoreCache
217+ : undefined ,
210218 } ,
211219 } ) as {
212220 structuredContent : {
Original file line number Diff line number Diff line change @@ -159,13 +159,18 @@ export const listTools = createIntegrationManagementTool({
159159 description : "List tools of a given integration" ,
160160 inputSchema : IntegrationSchema . pick ( {
161161 connection : true ,
162+ } ) . extend ( {
163+ ignoreCache : z . boolean ( ) . optional ( ) . describe (
164+ "Whether to ignore the cache when listing tools" ,
165+ ) ,
162166 } ) ,
163- handler : async ( { connection } , c ) => {
167+ handler : async ( { connection, ignoreCache } , c ) => {
164168 c . resourceAccess . grant ( ) ;
165169
166170 const result = await listToolsByConnectionType (
167171 connection ,
168172 c ,
173+ ignoreCache ,
169174 ) ;
170175
171176 // Sort tools by name for consistent UI
You can’t perform that action at this time.
0 commit comments