Add comprehensive JSDoc comments to all API interfaces, types, and schema definitions. This documentation should: 1. Include links to official external documentation when available
Add comprehensive JSDoc comments to all API interfaces, types, and schema definitions. This documentation should:
This practice improves developer experience through enhanced IDE tooltips and makes the code more maintainable by new team members.
Example:
/**
* Web search tool result error content
* @see https://docs.anthropic.com/en/docs/build-with-claude/tool-use/web-search-tool#errors
*/
export interface AnthropicWebSearchToolResultErrorContent {
/** Identifies this as a web search tool error response */
type: 'web_search_tool_result_error';
/** Error code from the API (e.g., 'max_uses_exceeded', 'too_many_requests') */
error_code: string;
}
// For schemas with multiple properties:
const providerOptionsSchema = z.object({
/** Language code (ISO-639-1) for transcription, e.g. 'en-US' */
language: z.string().nullish(),
/** Start position in seconds for partial audio processing */
audioStartAt: z.number().int().nullish(),
});
Enter the URL of a public GitHub repository