Skip to content

Python: [Bug]: FoundryEvals omits arguments for zero-argument tool calls, causing tool-aware Foundry evaluators to fail #7714

Description

Description

When using FoundryEvals with tool-aware evaluators such as:

  • task_adherence
  • tool_output_utilization
  • tool_call_accuracy

the evaluation fails if the conversation contains a tool call for a tool that takes no model-supplied arguments.

The resulting Foundry error is:

Each tool_call content items must contain a arguments field.

From debugging, it looks like the issue is in the Agent Framework conversion layer that builds the Foundry eval payload. In AgentEvalConverter.convert_message, the arguments field is only included when args is truthy:

if args:
    tc["arguments"] = args

For zero-argument tools, that omits the arguments field entirely, but Foundry’s tool-aware evaluators appear to require:

"arguments": {}

even when the tool call has no arguments.

Expected behavior

FoundryEvals should emit an arguments field for every tool_call content item, using {} when the tool has no arguments.

Actual behavior

FoundryEvals uploads tool-call traces without arguments for zero-argument tools, and several tool-aware Foundry evaluators fail with FAILED_EXECUTION.

Code Sample

## Dummy Code (Generated By Cursor)


from agent_framework import Agent, EvalItem, Message, tool
from agent_framework.foundry import FoundryChatClient, FoundryEvals

@tool(name="get_site_summary", description="Return a site summary.")
async def get_site_summary(ctx):
    return '{"site":"demo","status":"ok"}'

chat_client = FoundryChatClient(
    project_endpoint="<foundry-project-endpoint>",
    model="<model-deployment-name>",
)

agent = Agent(
    client=chat_client,
    name="DemoAgent",
    instructions="Call the tool and summarize the result.",
    tools=[get_site_summary],
)

query_messages = [Message("user", ["Get the site summary."])]
response = await agent.run(query_messages)

conversation = query_messages + list(response.messages or [])
eval_item = EvalItem(
    conversation=conversation,
    tools=[get_site_summary],
)

foundry_evaluator = FoundryEvals(
    client=chat_client,
    model="<model-deployment-name>",
    evaluators=[
        FoundryEvals.TASK_ADHERENCE,
        FoundryEvals.TOOL_OUTPUT_UTILIZATION,
        FoundryEvals.TOOL_CALL_ACCURACY,
    ],
)

results = await foundry_evaluator.evaluate([eval_item], eval_name="zero-arg-tool-repro")
print(results)

Error Messages / Stack Traces

{
            "type": "azure_ai_evaluator",
            "name": "task_adherence",
            "metric": "task_adherence",
            "score": null,
            "label": null,
            "reason": null,
            "threshold": null,
            "passed": null,
            "status": "error",
            "sample":
            {
                "error":
                {
                    "code": "FAILED_EXECUTION",
                    "message": "Error during evaluation with TaskAdherenceEvaluator: (UserError) Each tool_call content items must contain a 'arguments' field."
                }
            }
        },
        {
            "type": "azure_ai_evaluator",
            "name": "tool_output_utilization",
            "metric": "tool_output_utilization",
            "score": null,
            "label": null,
            "reason": null,
            "threshold": null,
            "passed": null,
            "status": "error",
            "sample":
            {
                "error":
                {
                    "code": "FAILED_EXECUTION",
                    "message": "Error during evaluation with ToolOutputUtilizationEvaluator: (UserError) Each tool_call content items must contain a 'arguments' field."
                }
            }
        },
        {
            "type": "azure_ai_evaluator",
            "name": "tool_call_accuracy",
            "metric": "tool_call_accuracy",
            "score": null,
            "label": null,
            "reason": null,
            "threshold": null,
            "passed": null,
            "status": "error",
            "sample":
            {
                "error":
                {
                    "code": "FAILED_EXECUTION",
                    "message": "Error during evaluation with ToolCallAccuracyEvaluator: (UserError) Each tool_call content items must contain a 'arguments' field."
                }
            }
        }
    ]

Package Versions

Using the notebook environment / project virtualenv: - agent-framework-core==1.12.1 - agent-framework-foundry==1.10.3 - agent-framework-openai==1.11.0 Project dependency declaration: - agent-framework-foundry>=1.10.3

Python Version

Python 3.14.2

Additional Context

No response

Metadata

Metadata

Labels

pythonUsage: [Issues, PRs], Target: PythonreproducedUsage: [Issues], Target: all issues that can be reproduced by the triage workflow

Type

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions