File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " @deco/mcp" ,
3- "version" : " 0.3.9 " ,
3+ "version" : " 0.4.0 " ,
44 "exports" : {
55 "." : " ./mod.ts" ,
66 "./http" : " ./mcp/http.ts"
Original file line number Diff line number Diff line change @@ -72,6 +72,7 @@ export interface Tool {
7272 name : string ;
7373 icon ?: string ;
7474 resolveType : string ;
75+ appName ?: string ;
7576 description : string ;
7677 outputSchema : JSONSchema7 ;
7778 inputSchema : JSONSchema7 ;
@@ -81,6 +82,7 @@ export const getTools = <TManifest extends AppManifest>(
8182 toolNames : Map < string , string > ,
8283 schemas ?: Schemas ,
8384 options ?: Options < TManifest > ,
85+ apps ?: Record < string , { namespace : string } > ,
8486) : Tool [ ] => {
8587 if ( ! schemas ) return [ ] ;
8688
@@ -188,6 +190,7 @@ export const getTools = <TManifest extends AppManifest>(
188190 return {
189191 name : toolName ,
190192 resolveType,
193+ appName : apps ?. [ resolveType ] ?. namespace ,
191194 description : funcDefinition . description ?? inputSchema ?. description ??
192195 resolveType ,
193196 icon,
@@ -227,7 +230,14 @@ function registerTools<TManifest extends AppManifest>(
227230 const meta = await deco . meta ( ) . then ( ( v ) => v ?. value ) ;
228231 if ( ! meta ) return { tools : [ ] } ;
229232 const schemas = meta . schema ;
230- return { tools : getTools ( toolNames , schemas , options ) } ;
233+ return {
234+ tools : getTools (
235+ toolNames ,
236+ schemas ,
237+ options ,
238+ meta ?. manifest ?. blocks ?. apps ,
239+ ) ,
240+ } ;
231241 } ;
232242
233243 const listTools : ListToolsMiddleware = compose (
You can’t perform that action at this time.
0 commit comments