Hi, I was wondering if sequential tool calling is possible. I have these 2 functions below:
$tools = [
[
'name' => 'user_attendance_data',
'type' => 'function',
'function' => [
'name' => 'get_user_attendance_data',
'description' => "Get user's attendance records ONLY for clock-in/clock-out and lates. Does NOT include filed absences, leaves, or approved time off.",
'parameters' => [
'type' => 'object',
'properties' => [
'year' => [
'type' => 'number',
'description' => 'Optional: The year to filter attendance dates. Defaults to current year.'
],
'month' => [
'type' => 'number',
'description' => 'Optional: Specific month to retrieve attendance from.'
],
// 'date' => [
// 'type' => 'string',
// 'description' => 'Optional: Specific date to retrieve attendance from.',
// 'default' => $today
// ],
],
'required' => [],
'additionalProperties' => false,
],
],
],
[
'name' => 'get_filed_absences',
'type' => 'function',
'function' => [
'name' => 'get_filed_absences',
'description' => "Get user's FILED absences and leaves ONLY (VL, SL, etc). Does NOT include lates, missing logs, or attendance records.",
'parameters' => [
'type' => 'object',
'properties' => [
'year' => [
'type' => ['number', 'string'],
'description' => 'Optional: The year to filter absence dates. Can be a number or "oldest". Defaults to current year.'
],
'month' => [
'type' => 'number',
'description' => 'Optional: Specific month to retrieve absence from.'
],
'include_archived' => [
'type' => 'boolean',
'description' => 'Optional: If true, include archived absences. Defaults to false.'
]
],
'required' => [],
'additionalProperties' => false,
],
],
],
]
I have encountered this problem where the user prompts “My lates and absences this month” which requires 2 sequentials functions to complete. It instead tried to call the 2 functions in one call by appending the function names. Please see the log below.
[2025-12-22 13:57:45] local.INFO: Iteration number: 1
[2025-12-22 13:57:47] local.INFO: result: {"type":"tool_call","tool_call":{"id":"call_ztSyfV91MoXHcwqqA7jDqtJb","name":"get_user_attendance_dataget_filed_absences","arguments":null},"text":""}
[2025-12-22 13:57:47] local.INFO: Iteration number: 2
[2025-12-22 13:57:49] local.INFO: result: {"type":"tool_call","tool_call":{"id":"call_bFjdz6BYD9IdNbkL5rBEJUE6","name":"get_user_attendance_dataget_filed_absences","arguments":null},"text":""}
[2025-12-22 13:57:49] local.INFO: Iteration number: 3
[2025-12-22 13:57:50] local.INFO: result: {"type":"tool_call","tool_call":{"id":"call_zvpKrtlFS4eSGjYFsV8Hooqj","name":"get_user_attendance_dataget_filed_absences","arguments":null},"text":""}
[2025-12-22 13:57:50] local.INFO: Iteration number: 4
[2025-12-22 13:57:51] local.INFO: result: {"type":"tool_call","tool_call":{"id":"call_llq9xJNp83QbKxb6I9J9g2xM","name":"get_user_attendance_dataget_filed_absences","arguments":null},"text":""}
[2025-12-22 13:57:51] local.WARNING: Exited tool loop after reaching max iterations.