aws / aws/agentcore-cli

Support invoking a specific runtime endpoint with `agentcore invoke --endpoint <name>`

Open
#1,554 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
283
Forks
95
Avg merge
1d 2h
Merged PRs (30d)
183

Description

### Summary

`agentcore invoke` always calls a runtime's `DEFAULT` endpoint. There is no way to invoke a specific **named runtime endpoint** (version alias) created with `agentcore add runtime-endpoint`. Please add a flag (e.g. `--endpoint `) to `agentcore invoke` to target a specific endpoint.

### Current behavior

- `agentcore add runtime-endpoint --runtime MyAgent --endpoint control --version 1` creates named endpoints, but `agentcore invoke` provides no way to call them.
- `agentcore invoke` exposes `--runtime`, `--target`, `--gateway`, and `--gateway-target-name`, but **no** `--endpoint`.
- `--target` is easy to mistake for endpoint selection — it actually selects the **deployment target** (account/region). For example, `agentcore invoke --runtime MyAgent --target control` fails with `Target 'control' not found. Available: default`.
- The data-plane invoke helper already accepts an endpoint qualifier (it defaults to `DEFAULT`), so the underlying call supports this — `invoke` just never passes a non-default value through.

### Requested behavior

Add an endpoint selector to `agentcore invoke`, for example:

```bash
agentcore invoke --runtime MyAgent --endpoint control --prompt "..."
```

Ideally mirroring the precedent already set by `agentcore run eval`, which supports:

```
--endpoint Runtime endpoint name (e.g. PROMPT_V1).
Defaults to AGENTCORE_RUNTIME_ENDPOINT env var, then DEFAULT
```

i.e. `--endpoint` plus an `AGENTCORE_RUNTIME_ENDPOINT` environment-variable fallback would make `invoke` consistent with `run eval`.

### Use case

Validating multiple runtime versions before/during an A/B test. After creating `control` (v1) and `treatment` (v2) endpoints, you can't smoke-test each one directly with `agentcore invoke` — today the only way to exercise a non-default endpoint is to route traffic through a gateway. Direct per-endpoint invocation would make it much easier to sanity-check each variant before sending live traffic.

### Workaround today

Send traffic to the test's gateway invocation URL (the gateway splits across endpoints), or invoke the `DEFAULT` endpoint only.

Contributor guide

Open the contributing guide

Research direction

Start at the `agentcore invoke` command and compare its option handling and endpoint forwarding with `agentcore run eval`; inspect the existing data-plane invoke helper's endpoint qualifier and the `AGENTCORE_RUNTIME_ENDPOINT` fallback precedent. Done means named endpoints can be selected directly, the fallback remains DEFAULT, and existing invoke options still work.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli, cloud
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.