File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 11from collections .abc import Awaitable , Callable
22from datetime import timedelta
3+ import logging
34from typing import Any , Protocol , TypeAlias
45
56import anyio .lowlevel
1314from mcp .shared .session import BaseSession , ProgressFnT , RequestResponder
1415from mcp .shared .version import SUPPORTED_PROTOCOL_VERSIONS
1516
16- DEFAULT_CLIENT_INFO = types .Implementation (name = "mcp" , version = "0.1.0" )
1717
18+ logger = logging .getLogger (__name__ )
19+
20+ DEFAULT_CLIENT_INFO = types .Implementation (name = "mcp" , version = "0.1.0" )
1821
1922class SamplingFnT (Protocol ):
2023 async def __call__ (
@@ -472,16 +475,16 @@ async def __call__(
472475 raise RuntimeError (f"Unknown tool { request .params .name } " )
473476 elif schema is False :
474477 # no schema
475- # TODO add logging
478+ logging . debug ( 'No schema found checking structuredContent is empty' )
476479 return result .structuredContent is None
477480 else :
478481 try :
479482 # TODO opportunity to build jsonschema.protocol.Validator
480483 # and reuse rather than build every time
481484 validate (result .structuredContent , schema )
482485 return True
483- except ValidationError :
484- # TODO log this
486+ except ValidationError as e :
487+ logging . exception ( e )
485488 return False
486489
487490 async def _refresh_schema_cache (self ):
You can’t perform that action at this time.
0 commit comments