Skip to content

feat: add API Tool for generic HTTP requests#14

Merged
vertefra merged 2 commits intomainfrom
feat/api-tool
Feb 8, 2026
Merged

feat: add API Tool for generic HTTP requests#14
vertefra merged 2 commits intomainfrom
feat/api-tool

Conversation

@vertefra
Copy link
Contributor

@vertefra vertefra commented Feb 8, 2026

Summary

This PR introduces a new generic API Tool that enables agents to make HTTP requests to configured endpoints. The tool provides a flexible, secure, and extensible way to integrate external APIs into agent workflows.

Changes

Added

  • API Tool: New generic API tool for making HTTP requests to configured endpoints
    • Support for GET, POST, PUT, DELETE, PATCH methods
    • URL parameter substitution (e.g., /users/{user_id})
    • Query parameter support (e.g., ?limit=10&offset=0)
    • Request body support for POST/PUT/PATCH
    • Authentication hooks for adding auth headers without exposing secrets to agents
    • Per-endpoint validation functions for parameter safety
    • Validator registry with built-in validators (ValidatePositiveIntParam, ValidateRequiredParams, ValidateBodyMaxSize)
    • Hook registry for reusable authentication patterns
    • YAML configuration support
    • Dynamic endpoint discovery - agent automatically sees all available endpoints
    • Complete Pokemon API example demonstrating usage

Documentation

  • Added comprehensive API Tool documentation in README.md
  • Created API Tool README with detailed usage examples
  • Added Pokemon API example configuration and documentation
  • Updated Table of Contents to include Built-in Tools section

Modified Files

  • .agent/workflows/release.md - Added release workflow documentation
  • CHANGELOG.md - Updated with API Tool features
  • README.md - Added API Tool documentation section
  • cmd/chat/main.go - Integrated API tool builder
  • src/builder/tools.go - Added API tool builder support
  • src/tools/api/ - New API tool implementation (8 files)
  • docs/API_TOOL_QUICKSTART.md - Quick start guide
  • docs/TOOLS.md - Tools documentation
  • examples/ - Added Pokemon API example

Removed

  • test-report.md - Removed outdated test report

Testing Notes

  • API Tool can be configured via YAML configuration files
  • Example configuration provided for Pokemon API
  • Validation functions ensure parameter safety
  • Authentication hooks allow secure API integration without exposing secrets

Breaking Changes

None - this is a new feature addition.

Related

Implements generic API integration capability for agents.

vertefra and others added 2 commits February 8, 2026 08:41
- Add generic API tool supporting GET, POST, PUT, DELETE, PATCH methods
- Support URL parameter substitution and query parameters
- Add authentication hooks and validation functions
- Include YAML configuration support and dynamic endpoint discovery
- Add comprehensive documentation and Pokemon API example
- Remove test-report.md

Co-authored-by: Cursor <cursoragent@cursor.com>
- Check error return from resp.Body.Close()
- Remove unnecessary fmt.Sprintf calls
- Fix gofmt formatting issues

Co-authored-by: Cursor <cursoragent@cursor.com>
@vertefra vertefra merged commit 02974b1 into main Feb 8, 2026
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