MCPcopy Index your code
hub / github.com/google/adk-python / _get_declaration

Method _get_declaration

src/google/adk/tools/agent_tool.py:402–429  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

400
401 @override
402 def _get_declaration(self) -> types.FunctionDeclaration:
403 from ..utils.variant_utils import GoogleLLMVariant
404
405 input_schema = _get_input_schema(self.agent) or _DefaultTaskInput
406
407 from . import _function_tool_declarations
408
409 result = (
410 _function_tool_declarations.build_function_declaration_with_json_schema(
411 func=input_schema
412 )
413 )
414 base_desc = self.agent.description or ''
415 suffix = (
416 '\nIMPORTANT: This tool delegates execution to a specialized agent.'
417 ' Do NOT call this tool in parallel with any other tools.'
418 )
419 result.description = f'{base_desc}{suffix}'.strip()
420 result.name = self.name
421
422 if self._api_variant != GoogleLLMVariant.GEMINI_API:
423 output_schema = _get_output_schema(self.agent)
424 if output_schema:
425 result.response_json_schema = {'type': 'object'}
426 else:
427 result.response_json_schema = {'type': 'string'}
428
429 return result
430
431 @override
432 async def run_async(

Callers

nothing calls this directly

Calls 3

_get_input_schemaFunction · 0.85
_get_output_schemaFunction · 0.85
stripMethod · 0.80

Tested by

no test coverage detected