aws / aws/bedrock-agentcore-starter-toolkit
[BUG] Function schema tool names exceed 64 character limit causing ValidationException
- Dominant language
- Python
- Stars
- 508
- Forks
- 155
- Avg merge
- 8h 50m
- Merged PRs (30d)
- 4
Description
## Bug Description
When importing Bedrock Agents with function-based action groups, tool names exceed 64-character limit, causing ValidationException during agent invocation.
## Steps to Reproduce
1. Create Bedrock Agent with function schema action group (long names)
2. Run: `agentcore import-agent --agent-id AGENT_ID --target-platform strands`
3. Invoke the deployed agent
4. Error occurs: "Member must have length less than or equal to 64"
## Expected Behavior
Tool names should be automatically truncated to stay within 64-character limit
## Actual Behavior
Tool names like `vacationsactiongroup___vacationsactiongroup_get_available_vacations_days` (67 chars) exceed limit
## Root Cause
In `base_bedrock_translate.py` line 1317, function schema uses default prune length (50) but doesn't account for the `{clean_action_group_name}___` prefix added later.
## Suggested Fix
Apply same length calculation as OpenAPI schema:
```
tool_name = prune_tool_name(
f"{action_group_name}_{clean_func_name}",
length=(54 - len(clean_action_group_name))
)
```
## Environment
- OS: macOS
- Python: 3.12
- Agent type: Function schema action groups
Contributor guide
Research direction
Start in base_bedrock_translate.py around line 1317 and compare the function-schema naming logic with the OpenAPI schema handling. Reproduce with `agentcore import-agent --agent-id AGENT_ID --target-platform strands`, then invoke the deployed agent. Done means generated function tool names stay within 64 characters and the ValidationException no longer occurs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, python
- Domain
- cli, cloud
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 70/100