Skip to content

feat(openapi): implement rest api tool (part 3)#386

Open
AmaadMartin wants to merge 2 commits into
google:mainfrom
AmaadMartin:feat/openapi_tool_part3
Open

feat(openapi): implement rest api tool (part 3)#386
AmaadMartin wants to merge 2 commits into
google:mainfrom
AmaadMartin:feat/openapi_tool_part3

Conversation

@AmaadMartin

Copy link
Copy Markdown
Collaborator

Link to Issue or Description of Change

Problem:
Developers lacked a dynamic BaseTool class capable of mapping LLM function call arguments to REST API paths, headers, query params, and payloads.

Solution:
Implemented RestApiTool (Part 3 of 4):

  • rest_api_tool.ts: A robust tool implementation that leverages operation definitions to format HTTP requests, resolve credentials using ToolAuthHandler, execute API calls, and format responses.

Testing Plan

Unit Tests:

  • I have added or updated unit tests for my change.
  • All unit tests pass locally.

Summary of passed results:

  • Unit tested argument formatting, query param mapping, auth handling, and dynamic tool schema generation.
  • Actual Line Coverage by File:
    • rest_api_tool.ts: 95.78%

Checklist

  • I have performed a self-review of my own code.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.

@AmaadMartin AmaadMartin changed the base branch from main to feat/openapi_tool_part2 May 27, 2026 20:38
Amaad Martin added 2 commits June 8, 2026 18:31
This implements RestApiTool for executing operations defined in OpenAPI specs.

TAG=agy
CONV=5d70d8ac-425c-4f8c-a969-97b17ecc66ce
…t 3)

- Imported OperationEndpoint from openapi_spec_parser instead of redefining it.
- Exported RestApiTool in common.ts.
- Changed relative imports in rest_api_tool_test.ts to import from @google/adk.

TAG=agy
CONV=5d70d8ac-425c-4f8c-a969-97b17ecc66ce
@AmaadMartin AmaadMartin force-pushed the feat/openapi_tool_part3 branch 2 times, most recently from b45cb71 to e67c93f Compare June 9, 2026 01:34
@AmaadMartin AmaadMartin changed the base branch from feat/openapi_tool_part2 to main June 9, 2026 01:35
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.

1 participant