@juspay/neurolink
Version:
Universal AI Development Platform with working MCP integration, multi-provider support, and professional CLI. Built-in tools operational, 58+ external MCP servers discoverable. Connect to filesystem, GitHub, database operations, and more. Build, test, and
51 lines (50 loc) • 1.76 kB
TypeScript
/**
* FlexibleToolValidator - Universal Safety Checks Only
*
* Following Anthropic's MCP specification which intentionally leaves tool naming flexible,
* this validator only blocks truly dangerous cases to support maximum MCP tool compatibility.
*
* Phase 1 Implementation:
* - Universal safety checks only (empty names, control characters, excessive length)
* - No context-specific validation or arbitrary pattern restrictions
* - Designed to support ALL legitimate MCP tools (github.create_repo, filesystem.read_file, etc.)
*/
export interface FlexibleValidationResult {
isValid: boolean;
error?: string;
warnings?: string[];
}
export declare class FlexibleToolValidator {
private static readonly MAX_TOOL_NAME_LENGTH;
private static readonly MIN_TOOL_NAME_LENGTH;
/**
* Validate tool name with universal safety checks only
*
* This method only blocks truly dangerous cases:
* 1. Empty or whitespace-only names
* 2. Control characters that could break systems
* 3. Excessively long names that could cause memory issues
*
* Everything else is allowed to support maximum MCP tool compatibility.
*/
static validateToolName(toolId: string): FlexibleValidationResult;
/**
* Validate tool information with minimal safety checks
*/
static validateToolInfo(toolId: string, toolInfo: {
description?: string;
serverId?: string;
}): FlexibleValidationResult;
/**
* Get information about what this validator checks
*/
static getValidationInfo(): {
philosophy: string;
checks: string[];
whatIsAllowed: string[];
examples: {
valid: string[];
invalid: string[];
};
};
}