mcp-cisco-support
Version:
MCP server for Cisco Support APIs including Bug Search and future tools
100 lines • 3.46 kB
TypeScript
/**
* MCP Sampling Utilities
*
* Provides helper functions for server-initiated LLM requests through MCP sampling.
* Allows the server to leverage AI capabilities without requiring API keys.
*
* Note: Sampling requires client support - check client capabilities before use.
*/
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
/**
* Model preference priorities for sampling requests
* Values range from 0.0 to 1.0
*/
export interface ModelPreferences {
[key: string]: unknown;
/** How important is minimizing cost (0.0 = not important, 1.0 = very important) */
costPriority?: number;
/** How important is low latency (0.0 = not important, 1.0 = very important) */
speedPriority?: number;
/** How important are advanced capabilities (0.0 = not important, 1.0 = very important) */
intelligencePriority?: number;
/** Optional model name hints (treated as substring matches) */
hints?: Array<{
[key: string]: unknown;
name?: string;
}>;
}
/**
* Sampling request options
*/
export interface SamplingOptions {
/** The prompt/message to send to the LLM */
message: string;
/** System prompt for context */
systemPrompt?: string;
/** Maximum tokens to generate */
maxTokens?: number;
/** Model preferences */
modelPreferences?: ModelPreferences;
/** Temperature for generation (0.0 to 1.0) */
temperature?: number;
}
/**
* Check if the client supports sampling
*/
export declare function clientSupportsSampling(server: Server): boolean;
/**
* Request LLM completion from the client via sampling
*
* @param server - MCP Server instance
* @param options - Sampling request options
* @returns The LLM response text
* @throws Error if client doesn't support sampling
*/
export declare function requestSampling(server: Server, options: SamplingOptions): Promise<string>;
/**
* Request intelligent product name resolution
* Converts natural language product descriptions to product IDs
*
* @example
* resolveProductName(server, "Catalyst 9200 24-port switch")
* // Returns: "C9200-24P"
*/
export declare function resolveProductName(server: Server, productDescription: string): Promise<string>;
/**
* Categorize bug severity and impact using LLM analysis
*
* @example
* categorizeBug(server, bugDescription)
* // Returns: { severity: "high", impact: "network-outage", category: "routing" }
*/
export declare function categorizeBug(server: Server, bugDescription: string): Promise<{
severity: string;
impact: string;
category: string;
}>;
/**
* Analyze software upgrade risk using LLM
*
* @example
* analyzeUpgradeRisk(server, currentVersion, targetVersion, bugData)
* // Returns: Detailed risk analysis and recommendations
*/
export declare function analyzeUpgradeRisk(server: Server, productId: string, currentVersion: string, targetVersion: string, bugData: any): Promise<string>;
/**
* Generate natural language summary of bug search results
*/
export declare function summarizeBugs(server: Server, bugs: any[], searchContext: string): Promise<string>;
/**
* Extract structured product information from natural language query
*/
export declare function extractProductQuery(server: Server, naturalQuery: string): Promise<{
productId?: string;
productSeries?: string;
version?: string;
severity?: number;
status?: string;
keywords?: string[];
}>;
//# sourceMappingURL=sampling.d.ts.map