Skip to content

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

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

feat(openapi): implement rest api tool (part 3)#386
AmaadMartin wants to merge 2 commits into
google:feat/openapi_tool_part2from
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.

This implements RestApiTool for executing operations defined in OpenAPI specs.

TAG=agy
CONV=5d70d8ac-425c-4f8c-a969-97b17ecc66ce
@AmaadMartin AmaadMartin changed the base branch from main to feat/openapi_tool_part2 May 27, 2026 20:38
TAG=agy
CONV=5d70d8ac-425c-4f8c-a969-97b17ecc66ce
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