Skip to content

[Server] Log expected tool failures at debug level - #433

Open
ousamabenyounes wants to merge 1 commit into
modelcontextprotocol:mainfrom
ousamabenyounes:fix/issue-157
Open

[Server] Log expected tool failures at debug level#433
ousamabenyounes wants to merge 1 commit into
modelcontextprotocol:mainfrom
ousamabenyounes:fix/issue-157

Conversation

@ousamabenyounes

Copy link
Copy Markdown

Summary

  • log expected ToolCallException failures at debug severity instead of error severity
  • keep unexpected exceptions at error severity
  • preserve and verify the existing log message and context

Fixes #157

Test verification (RED → GREEN)

Before the production change, the focused regression test failed with:

Expected level: debug
Actual level: error
FAILURES! Tests: 1, Assertions: 1, Failures: 1.

After the change:

OK (26 tests, 125 assertions)

Full local CI replay:

PHP CS Fixer: 0 files can be fixed
PHPStan: No errors
PHPUnit: OK (1247 tests, 3396 assertions)
phpDocumentor: complete
php-diff-coverage: PASS 1/1 changed executable lines covered

Expected tool failures are part of normal tool execution, so log them at debug severity while preserving error logging for unexpected exceptions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Server] Lower log level on failing tool calls

1 participant