Optionalcapabilities?: ClientCapabilitiesOptionaljsonSchemaValidator?: jsonSchemaValidatorJSON Schema validator for tool output validation.
The validator is used to validate structured content returned by tools against their declared output schemas.
DefaultJsonSchemaValidator (AjvJsonSchemaValidator on Node.js, CfWorkerJsonSchemaValidator on Cloudflare Workers)
OptionallistChanged?: ListChangedHandlersConfigure handlers for list changed notifications (tools, prompts, resources).
const client = new Client(
{ name: 'my-client', version: '1.0.0' },
{
listChanged: {
tools: {
onChanged: (error, tools) => {
if (error) {
console.error('Failed to refresh tools:', error);
return;
}
console.log('Tools updated:', tools);
}
},
prompts: {
onChanged: (error, prompts) => console.log('Prompts updated:', prompts)
}
}
}
);
Capabilities to advertise as being supported by this client.