docs: fix grammar, typos, and style in JSDoc comments (#1491)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
efed431843
commit
7778c74e1f
10 changed files with 18 additions and 18 deletions
|
|
@ -60,7 +60,7 @@ export interface OAuthClientProvider {
|
|||
get clientMetadata(): OAuthClientMetadata;
|
||||
|
||||
/**
|
||||
* Returns a OAuth2 state parameter.
|
||||
* Returns an OAuth2 state parameter.
|
||||
*/
|
||||
state?(): string | Promise<string>;
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ export function createPrivateKeyJwtAuth(options: {
|
|||
// Lazy import to avoid heavy dependency unless used
|
||||
if (globalThis.crypto === undefined) {
|
||||
throw new TypeError(
|
||||
'crypto is not available, please ensure you add have Web Crypto API support for older Node.js versions (see https://github.com/modelcontextprotocol/typescript-sdk#nodejs-web-crypto-globalthiscrypto-compatibility)'
|
||||
'crypto is not available, please ensure you have Web Crypto API support for older Node.js versions (see https://github.com/modelcontextprotocol/typescript-sdk#nodejs-web-crypto-globalthiscrypto-compatibility)'
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ export interface StartSSEOptions {
|
|||
|
||||
/**
|
||||
* Override Message ID to associate with the replay message
|
||||
* so that response can be associate with the new resumed request.
|
||||
* so that the response can be associated with the new resumed request.
|
||||
*/
|
||||
replayMessageId?: string | number;
|
||||
}
|
||||
|
|
@ -255,7 +255,7 @@ export class StreamableHTTPClientTransport implements Transport {
|
|||
}
|
||||
|
||||
/**
|
||||
* Calculates the next reconnection delay using backoff algorithm
|
||||
* Calculates the next reconnection delay using a backoff algorithm
|
||||
*
|
||||
* @param attempt Current reconnection attempt count for the specific stream
|
||||
* @returns Time to wait in milliseconds before next reconnection attempt
|
||||
|
|
@ -463,7 +463,7 @@ export class StreamableHTTPClientTransport implements Transport {
|
|||
const { resumptionToken, onresumptiontoken } = options || {};
|
||||
|
||||
if (resumptionToken) {
|
||||
// If we have at last event ID, we need to reconnect the SSE stream
|
||||
// If we have a last event ID, we need to reconnect the SSE stream
|
||||
this._startOrAuthSse({ resumptionToken, replayMessageId: isJSONRPCRequest(message) ? message.id : undefined }).catch(
|
||||
error => this.onerror?.(error)
|
||||
);
|
||||
|
|
|
|||
|
|
@ -191,7 +191,7 @@ describe('createPrivateKeyJwtAuth', () => {
|
|||
const params = new URLSearchParams();
|
||||
|
||||
await expect(addClientAuth(new Headers(), params, 'https://auth.example.com/token', undefined)).rejects.toThrow(
|
||||
'crypto is not available, please ensure you add have Web Crypto API support for older Node.js versions'
|
||||
'crypto is not available, please ensure you have Web Crypto API support for older Node.js versions'
|
||||
);
|
||||
} finally {
|
||||
// Restore original crypto to avoid affecting other tests
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ export const OAuthErrorResponseSchema = z.object({
|
|||
});
|
||||
|
||||
/**
|
||||
* Optional version of SafeUrlSchema that allows empty string for retrocompatibility on tos_uri and logo_uri
|
||||
* Optional version of SafeUrlSchema that allows empty string for backward compatibility on tos_uri and logo_uri
|
||||
*/
|
||||
// eslint-disable-next-line unicorn/no-useless-undefined
|
||||
export const OptionalSafeUrlSchema = SafeUrlSchema.optional().or(z.literal('').transform(() => undefined));
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ export type ProtocolOptions = {
|
|||
};
|
||||
|
||||
/**
|
||||
* The default request timeout, in miliseconds.
|
||||
* The default request timeout, in milliseconds.
|
||||
*/
|
||||
export const DEFAULT_REQUEST_TIMEOUT_MSEC = 60_000;
|
||||
|
||||
|
|
@ -1023,7 +1023,7 @@ export abstract class Protocol<ContextT extends BaseContext> {
|
|||
protected abstract assertTaskCapability(method: string): void;
|
||||
|
||||
/**
|
||||
* A method to check if task handler is supported by the local side, for the given method to be handled.
|
||||
* A method to check if a task handler is supported by the local side, for the given method to be handled.
|
||||
*
|
||||
* This should be implemented by subclasses.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1187,7 +1187,7 @@ export const ImageContentSchema = z.object({
|
|||
});
|
||||
|
||||
/**
|
||||
* An Audio provided to or from an LLM.
|
||||
* Audio content provided to or from an LLM.
|
||||
*/
|
||||
export const AudioContentSchema = z.object({
|
||||
type: z.literal('audio'),
|
||||
|
|
@ -1340,7 +1340,7 @@ export const ToolAnnotationsSchema = z.object({
|
|||
|
||||
/**
|
||||
* If true, calling the tool repeatedly with the same arguments
|
||||
* will have no additional effect on the its environment.
|
||||
* will have no additional effect on its environment.
|
||||
*
|
||||
* (This property is meaningful only when `readOnlyHint == false`)
|
||||
*
|
||||
|
|
@ -2067,7 +2067,7 @@ export const ElicitResultSchema = ResultSchema.extend({
|
|||
/**
|
||||
* The user action in response to the elicitation.
|
||||
* - "accept": User submitted the form/confirmed the action
|
||||
* - "decline": User explicitly decline the action
|
||||
* - "decline": User explicitly declined the action
|
||||
* - "cancel": User dismissed without making an explicit choice
|
||||
*/
|
||||
action: z.enum(['accept', 'decline', 'cancel']),
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* Node.js HTTP Streamable HTTP Server Transport
|
||||
* Node.js Streamable HTTP Server Transport
|
||||
*
|
||||
* This is a thin wrapper around `WebStandardStreamableHTTPServerTransport` that provides
|
||||
* compatibility with Node.js HTTP server (IncomingMessage/ServerResponse).
|
||||
|
|
|
|||
|
|
@ -886,10 +886,10 @@ export class McpServer {
|
|||
|
||||
/**
|
||||
* Sends a logging message to the client, if connected.
|
||||
* Note: You only need to send the parameters object, not the entire JSON RPC message
|
||||
* Note: You only need to send the parameters object, not the entire JSON-RPC message.
|
||||
* @see LoggingMessageNotification
|
||||
* @param params
|
||||
* @param sessionId optional for stateless and backward compatibility
|
||||
* @param sessionId Optional for stateless transports and backward compatibility.
|
||||
*/
|
||||
async sendLoggingMessage(params: LoggingMessageNotification['params'], sessionId?: string) {
|
||||
return this.server.sendLoggingMessage(params, sessionId);
|
||||
|
|
@ -943,7 +943,7 @@ export class ResourceTemplate {
|
|||
uriTemplate: string | UriTemplate,
|
||||
private _callbacks: {
|
||||
/**
|
||||
* A callback to list all resources matching this template. This is required to specified, even if `undefined`, to avoid accidentally forgetting resource listing.
|
||||
* A callback to list all resources matching this template. This is required to be specified, even if `undefined`, to avoid accidentally forgetting resource listing.
|
||||
*/
|
||||
list: ListResourcesCallback | undefined;
|
||||
|
||||
|
|
|
|||
|
|
@ -634,10 +634,10 @@ export class Server extends Protocol<ServerContext> {
|
|||
|
||||
/**
|
||||
* Sends a logging message to the client, if connected.
|
||||
* Note: You only need to send the parameters object, not the entire JSON RPC message
|
||||
* Note: You only need to send the parameters object, not the entire JSON-RPC message.
|
||||
* @see LoggingMessageNotification
|
||||
* @param params
|
||||
* @param sessionId optional for stateless and backward compatibility
|
||||
* @param sessionId Optional for stateless transports and backward compatibility.
|
||||
*/
|
||||
async sendLoggingMessage(params: LoggingMessageNotification['params'], sessionId?: string) {
|
||||
if (this._capabilities.logging && !this.isMessageIgnored(params.level, sessionId)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue