Skip to content

ADK OpenAPIToolSet Not Including Parameter Description And required Field #247

Closed

Description

@sumant-pangotra

Observations:
While generating function declarations, all parameters are being treated as required—even when the required property is explicitly set to false.[1]
The description field of parameters is not being included in the VertexAI request schema for function declarations.[1]

Expected behavior
Ideally the LLM request should not include parameters in required list which have required: false .
Also the description of parameters should also be passed in function declaration in LLM request schema

Example
[1]
OpenAPI Spec
{"parameters":[{"name":"needTotalCount","in":"query","description":"Need Total Count","required":false,"schema":{"type":"boolean"}},{"name":"templateName","in":"query","description":"Identifier of the template to be used to prepare API response by providing a filtering mechanism","required":false,"schema":{"type":"string"}}]}

LLM Request:
{'contents': [{'parts': [{'text': 'find all user not logged in last 45 days'}], 'role': 'user'}], 'systemInstruction': {'parts': [{'text': '..............................'}], 'role': 'user'}, 'tools': [{'functionDeclarations': [{'description': 'The API allows you to create structured queries using the REST Query Language \n\n Either template name or template payload should be empty or null', 'name': 'quick_search_user_login_info', 'parameters': {'properties': {'need_total_count': {'type': <Type.BOOLEAN: 'BOOLEAN'>}, 'template_name': {'type': <Type.STRING: 'STRING'>}, 'query': {'type': <Type.STRING: 'STRING'>}, 'size': {'type': <Type.INTEGER: 'INTEGER'>}}, 'required': ['need_total_count', 'template_name', 'query', 'size'], 'type': <Type.OBJECT: 'OBJECT'>}}]}], 'generationConfig': {}}

Desktop (please complete the following information):

  • OS: [e.g. iOS] macOS 15.3.2
  • Python version(python -V): 3.11
  • ADK version(pip show google-adk): 0.1.0

Activity

  1. seanzhou1023 commented on Apr 17, 2025

    @seanzhou1023
    Collaborator

    could you show your source codes ? Don't quite understand your log, how did you feed the OpenAPIToolSet to your agent ?

    Usually the tools should be under Functions section , while I saw you put it in the system instruction. I guess you probably used it in an wrong way

  2. sumant-pangotra commented on Apr 17, 2025

    @sumant-pangotra
    ContributorAuthor

    could you show your source codes ? Don't quite understand your log, how did you feed the OpenAPIToolSet to your agent ?

    Usually the tools should be under Functions section , while I saw you put it in the system instruction. I guess you probably used it in an wrong way

    @seanzhou1023 , I have updated the LLM request that is being generated. Earlier while removing certain parts of system instruction I ended up removing tools section while copying

  3. seanzhou1023 commented on Apr 17, 2025

    @seanzhou1023
    Collaborator

    thanks @sumant-pangotra , but in your updated log, the "required" is empty list.

  4. sumant-pangotra commented on Apr 17, 2025

    @sumant-pangotra
    ContributorAuthor

    @seanzhou1023 , Updated the LLM request to actual value.
    Please ignore the value with empty required list [] as it was generated after I fixed the code in OpenAPI operation_parser.py file in my local system

  5. sumant-pangotra commented on Apr 17, 2025

    @sumant-pangotra
    ContributorAuthor

    @seanzhou1023 , I have raised a PR for review.

  6. added theissue type on Apr 18, 2025
  7. lenzpaul commented on Apr 30, 2025

    @lenzpaul

    I noticed this too, all the parameters are marked as requrired, even optional one.

  8. added a commit that references this issue on May 2, 2025
  9. seanzhou1023 commented on May 2, 2025

    @seanzhou1023
    Collaborator

    Thanks @sumant-pangotra , I've approved the PR, pls fix the errors

  10. added a commit that references this issue on May 2, 2025
  11. sumant-pangotra commented on May 2, 2025

    @sumant-pangotra
    ContributorAuthor

    Thanks @sumant-pangotra , I've approved the PR, pls fix the errors

    Done @seanzhou1023 , 'Waiting for internal safe review approval' Check is pending

  12. added a commit that references this issue on May 2, 2025
  13. added a commit that references this issue on May 2, 2025
  14. added 5 commits that reference this issue on Jul 2, 2025
  15. added 5 commits that reference this issue on Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions