Skip to content

Prog tool call#113

Merged
nmaguiar merged 2 commits intomainfrom
prog-tool-call
Feb 27, 2026
Merged

Prog tool call#113
nmaguiar merged 2 commits intomainfrom
prog-tool-call

Conversation

@nmaguiar
Copy link
Copy Markdown
Contributor

@nmaguiar nmaguiar commented Feb 27, 2026

This pull request introduces a new feature for programmatic MCP tool calling by adding an optional per-session localhost HTTP bridge (mcpprogcall). This allows scripts executed by the agent to list, search, and call MCP tools via REST endpoints, improving automation and integration capabilities. The feature is configurable with several new parameters for security, performance, and result management. Documentation and supporting files have been updated to describe and support this new bridge, and new tests have been added.

New Programmatic Tool Calling Bridge:

  • Added the mcpprogcall option and related configuration parameters (mcpprogcallport, mcpprogcallmaxbytes, mcpprogcallresultttl, mcpprogcalltools, mcpprogcallbatchmax) to enable a per-session localhost HTTP bridge for programmatic tool calls from scripts. This includes environment variable injection and REST endpoints for tool listing, searching, calling, batch calls, and result retrieval. (mini-a-con.js, mini-a-common.js, mini-a-progcall.js, README.md, USAGE.md, CHEATSHEET.md) [1] [2] [3] [4] [5] [6] [7] [8]

Documentation Updates:

  • Expanded documentation in README.md, USAGE.md, and CHEATSHEET.md to describe the new programmatic bridge, its configuration, usage examples, and available endpoints. [1] [2] [3] [4] [5] [6] [7]

Supporting Code and Utilities:

  • Added mini-a-progcall.js as the implementation for the HTTP bridge. [1] [2]
  • Added a utility function __miniABuildCompactToolManifest to build tool manifests for API responses, supporting both proxy and non-proxy modes. (mini-a-common.js)

Testing:

  • Added new test files for the programmatic tool calling bridge: tests/progToolCall.js and tests/progToolCall.yaml. [1] [2]

Housekeeping:

  • Removed unused precompiled files from the package manifest for cleanup. (.package.yaml) [1] [2]

Others:

  • Context deduplication improvements: A rewritten _deduplicateContext method with budget-based filtering, fingerprinting, and support for observation class budgets.

  • Chunked summarization: A new approach that splits large contexts into chunks before summarization to handle payloads that exceed LLM context windows.

  • Context overflow detection from response payload: Added detection of context-window overflow errors that appear in the LLM's response payload itself (not just from provider errors).

These changes collectively provide a robust, script-friendly interface for MCP tool automation, with clear documentation and tests to support adoption.

- Introduced a new test file `progToolCall.js` containing various tests for the ProgToolCall server functionality, including server start/stop, token rejection, tool listing, and more.
- Created a corresponding YAML configuration file `progToolCall.yaml` to define the test jobs and their execution order.
- Updated `autoTestAll.allJobs.yaml` to include the new `progToolCall.yaml` for comprehensive testing.
@nmaguiar nmaguiar self-assigned this Feb 27, 2026
@nmaguiar nmaguiar added bug Something isn't working enhancement New feature or request labels Feb 27, 2026
@nmaguiar nmaguiar requested a review from Copilot February 27, 2026 13:14
@nmaguiar nmaguiar marked this pull request as ready for review February 27, 2026 13:14
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request introduces a programmatic MCP tool calling feature via a per-session localhost HTTP bridge (mcpprogcall), enabling LLM-generated scripts to list, search, and call MCP tools through REST endpoints. The feature includes comprehensive configuration options, thorough documentation, and extensive test coverage. Additionally, the PR includes several unrelated improvements to context management and summarization that are not mentioned in the PR description.

Changes:

  • Added MiniAProgCallServer class implementing a per-session HTTP bridge for programmatic tool calls with REST endpoints, token authentication, result storage, and automatic cleanup
  • Added __miniABuildCompactToolManifest utility function for building proxy-aware tool manifests
  • Improved context deduplication with budget-based filtering and fingerprinting
  • Implemented chunked summarization to handle large contexts that exceed LLM limits
  • Added detection of context-window overflow errors from LLM response payloads
  • Updated documentation across README.md, USAGE.md, and CHEATSHEET.md
  • Added comprehensive test suite (20 test cases) covering server lifecycle, authentication, endpoints, and edge cases

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
mini-a-progcall.js New HTTP bridge server implementation with routes, authentication, result storage, and prompt generation
mini-a-common.js Added __miniABuildCompactToolManifest utility for building compact tool manifests with proxy awareness
mini-a.js Integrated progcall server lifecycle, environment variable injection, shutdown hooks, improved context deduplication, chunked summarization, and payload error detection
mini-a-con.js Added CLI parameter definitions for mcpprogcall feature configuration
tests/progToolCall.js Comprehensive test suite with 20 test cases covering all bridge functionality
tests/progToolCall.yaml oJob test orchestration for programmatic tool calling tests
tests/autoTestAll.allJobs.yaml Included new test suite in test runner
README.md Documented programmatic tool calling feature and configuration parameters
USAGE.md Added detailed usage guide with examples and endpoint documentation
CHEATSHEET.md Added quick reference for mcpprogcall parameters and usage
.package.yaml Added new files to package manifest and removed unused precompiled files

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread mini-a.js
@nmaguiar nmaguiar merged commit 4232ec1 into main Feb 27, 2026
4 checks passed
@nmaguiar nmaguiar deleted the prog-tool-call branch February 27, 2026 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants