You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tried running the example for autocomplete of ResourceTemplate and it gives a typing error when the complete function is specified alongside the required property for any of the arguments.
Here's how the type definition looks like with required and no complete:
Code
mcp.addResourceTemplate({uriTemplate: "file:///test",name: "Test",mimeType: "text/plain",arguments: [{name: "a",description: "Argument A",required: true},{name: "b",description: "Argument B",required: true},],load: async({ a, b })=>{// ...},});
Here's how the type definition looks like with complete and no required:
Code
mcp.addResourceTemplate({uriTemplate: "file:///test",name: "Test",mimeType: "text/plain",arguments: [{name: "a",description: "Argument A",complete: async(value)=>{// ...},},{name: "b",description: "Argument B",complete: async(value)=>{// ...},},],load: async({ a, b })=>{// ...},});
And here's the typing when adding required to any of the two arguments:
Object literal may only specify known properties, and 'required' does not exist in type 'Readonly<{ name: string; description?: string | undefined; complete?: ArgumentValueCompleter | undefined; }>
It compiles and run fine though so not a big deal, just a linting error.
The text was updated successfully, but these errors were encountered:
Hi,
Tried running the example for autocomplete of ResourceTemplate and it gives a typing error when the
complete
function is specified alongside therequired
property for any of the arguments.Here's how the type definition looks like with
required
and nocomplete
:Code
Here's how the type definition looks like with
complete
and norequired
:Code
And here's the typing when adding
required
to any of the two arguments:Code
With error being:
It compiles and run fine though so not a big deal, just a linting error.
The text was updated successfully, but these errors were encountered: