diff --git a/src/Capability/Discovery/Discoverer.php b/src/Capability/Discovery/Discoverer.php index 88ec4117..15468958 100644 --- a/src/Capability/Discovery/Discoverer.php +++ b/src/Capability/Discovery/Discoverer.php @@ -220,7 +220,7 @@ private function processMethod(\ReflectionMethod $method, array &$discoveredCoun case McpTool::class: $docBlock = $this->docBlockParser->parseDocBlock($method->getDocComment() ?? null); $name = $instance->name ?? ('__invoke' === $methodName ? $classShortName : $methodName); - $description = $instance->description ?? $this->docBlockParser->getSummary($docBlock) ?? null; + $description = $instance->description ?? $this->docBlockParser->getDescription($docBlock) ?? null; $inputSchema = $this->schemaGenerator->generate($method); $tool = new Tool( $name, @@ -237,7 +237,7 @@ private function processMethod(\ReflectionMethod $method, array &$discoveredCoun case McpResource::class: $docBlock = $this->docBlockParser->parseDocBlock($method->getDocComment() ?? null); $name = $instance->name ?? ('__invoke' === $methodName ? $classShortName : $methodName); - $description = $instance->description ?? $this->docBlockParser->getSummary($docBlock) ?? null; + $description = $instance->description ?? $this->docBlockParser->getDescription($docBlock) ?? null; $resource = new Resource( $instance->uri, $name, @@ -256,7 +256,7 @@ private function processMethod(\ReflectionMethod $method, array &$discoveredCoun case McpPrompt::class: $docBlock = $this->docBlockParser->parseDocBlock($method->getDocComment() ?? null); $name = $instance->name ?? ('__invoke' === $methodName ? $classShortName : $methodName); - $description = $instance->description ?? $this->docBlockParser->getSummary($docBlock) ?? null; + $description = $instance->description ?? $this->docBlockParser->getDescription($docBlock) ?? null; $arguments = []; $paramTags = $this->docBlockParser->getParamTags($docBlock); foreach ($method->getParameters() as $param) { @@ -276,7 +276,7 @@ private function processMethod(\ReflectionMethod $method, array &$discoveredCoun case McpResourceTemplate::class: $docBlock = $this->docBlockParser->parseDocBlock($method->getDocComment() ?? null); $name = $instance->name ?? ('__invoke' === $methodName ? $classShortName : $methodName); - $description = $instance->description ?? $this->docBlockParser->getSummary($docBlock) ?? null; + $description = $instance->description ?? $this->docBlockParser->getDescription($docBlock) ?? null; $mimeType = $instance->mimeType; $annotations = $instance->annotations; $meta = $instance->meta ?? null; diff --git a/tests/Inspector/Http/snapshots/HttpCombinedRegistrationTest-resources_list.json b/tests/Inspector/Http/snapshots/HttpCombinedRegistrationTest-resources_list.json index 2d0c6ce2..2c7912e4 100644 --- a/tests/Inspector/Http/snapshots/HttpCombinedRegistrationTest-resources_list.json +++ b/tests/Inspector/Http/snapshots/HttpCombinedRegistrationTest-resources_list.json @@ -3,7 +3,7 @@ { "name": "priority_config_discovered", "uri": "config://priority", - "description": "A resource discovered via attributes." + "description": "A resource discovered via attributes.\n\nThis will be overridden by a manual registration with the same URI." } ] } diff --git a/tests/Inspector/Http/snapshots/HttpComplexToolSchemaTest-tools_list.json b/tests/Inspector/Http/snapshots/HttpComplexToolSchemaTest-tools_list.json index 5f47adca..5f9db0f5 100644 --- a/tests/Inspector/Http/snapshots/HttpComplexToolSchemaTest-tools_list.json +++ b/tests/Inspector/Http/snapshots/HttpComplexToolSchemaTest-tools_list.json @@ -2,7 +2,7 @@ "tools": [ { "name": "schedule_event", - "description": "Schedules a new event.", + "description": "Schedules a new event.\n\nThe inputSchema for this tool will reflect all parameter types and defaults.", "inputSchema": { "type": "object", "properties": { diff --git a/tests/Inspector/Http/snapshots/HttpDiscoveryUserProfileTest-tools_list.json b/tests/Inspector/Http/snapshots/HttpDiscoveryUserProfileTest-tools_list.json index f515430e..205ad0ce 100644 --- a/tests/Inspector/Http/snapshots/HttpDiscoveryUserProfileTest-tools_list.json +++ b/tests/Inspector/Http/snapshots/HttpDiscoveryUserProfileTest-tools_list.json @@ -25,7 +25,7 @@ }, { "name": "send_welcome", - "description": "Sends a welcome message to a user.", + "description": "Sends a welcome message to a user.\n\n(This is a placeholder - in a real app, it might queue an email).", "inputSchema": { "type": "object", "properties": { diff --git a/tests/Inspector/Http/snapshots/HttpSchemaShowcaseTest-tools_list.json b/tests/Inspector/Http/snapshots/HttpSchemaShowcaseTest-tools_list.json index 9b9b90e7..f79bfeba 100644 --- a/tests/Inspector/Http/snapshots/HttpSchemaShowcaseTest-tools_list.json +++ b/tests/Inspector/Http/snapshots/HttpSchemaShowcaseTest-tools_list.json @@ -32,7 +32,7 @@ }, { "name": "calculate_range", - "description": "Performs mathematical operations with numeric constraints.", + "description": "Performs mathematical operations with numeric constraints.\n\nDemonstrates: METHOD-LEVEL Schema", "inputSchema": { "type": "object", "properties": { diff --git a/tests/Inspector/Stdio/snapshots/StdioDiscoveryCalculatorTest-tools_list.json b/tests/Inspector/Stdio/snapshots/StdioDiscoveryCalculatorTest-tools_list.json index 5f184117..8ada3477 100644 --- a/tests/Inspector/Stdio/snapshots/StdioDiscoveryCalculatorTest-tools_list.json +++ b/tests/Inspector/Stdio/snapshots/StdioDiscoveryCalculatorTest-tools_list.json @@ -2,7 +2,7 @@ "tools": [ { "name": "calculate", - "description": "Performs a calculation based on the operation.", + "description": "Performs a calculation based on the operation.\n\nSupports 'add', 'subtract', 'multiply', 'divide'.\nObeys the 'precision' and 'allow_negative' settings from the config resource.", "icons": [ { "mimeType": "image/svg+xml", @@ -37,7 +37,7 @@ }, { "name": "update_setting", - "description": "Updates a specific configuration setting.", + "description": "Updates a specific configuration setting.\n\nNote: This requires more robust validation in a real app.", "inputSchema": { "type": "object", "properties": { diff --git a/tests/Inspector/Stdio/snapshots/StdioEnvVariablesTest-tools_list.json b/tests/Inspector/Stdio/snapshots/StdioEnvVariablesTest-tools_list.json index 32141675..7cac70bc 100644 --- a/tests/Inspector/Stdio/snapshots/StdioEnvVariablesTest-tools_list.json +++ b/tests/Inspector/Stdio/snapshots/StdioEnvVariablesTest-tools_list.json @@ -2,7 +2,7 @@ "tools": [ { "name": "process_data_by_mode", - "description": "Performs an action that can be modified by an environment variable.", + "description": "Performs an action that can be modified by an environment variable.\n\nThe MCP client should set 'APP_MODE' in its 'env' config for this server.", "inputSchema": { "type": "object", "properties": {