CASE FILE Agent Tool Use Β§6/6 ← FILES DOSSIER PRINT
Task

Define And Test

Task: Write and Test a Tool Definition

You are building an autonomous assistant for a Seoul high-school library. One of its jobs is to help students reserve study rooms. The assistant should be able to call a function to check availability and book a room.

Your task has two parts:

Part 1: Write the Tool Definition

Write a complete tool definition (in JSON format) for a function called reserve_study_room. The tool must specify:

  1. name β€” exact function name

  2. description β€” what the tool does and when to use it (2–3 sentences)

  3. parameters β€” a JSON Schema object with these fields (all required):

    • room_number β€” identifier for the room (e.g., "A1", "B3")
    • date β€” the date requested (format: YYYY-MM-DD)
    • start_time β€” when the reservation begins (format: HH:MM in 24-hour time)
    • duration_minutes β€” how long to reserve (integer, 30–240 minutes)
    • student_id β€” the student's ID number (integer)

    For each parameter, specify:

    • type (string or integer)
    • description (what it accepts and any constraints)
    • Mark all as required
  4. returns β€” a description of what the tool sends back (e.g., success status, confirmation number, error message)

Constraint: Your description and schema must be precise enough that an AI model reading it could call the tool correctly without human intervention. No vague phrasing like "some time" or "any ID".

Part 2: Spot the Weak Point

Consider this scenario: A student asks the assistant, "I want to study in room B3 at 2:30 PM for an hour and a half starting tomorrow."

The assistant processes this and calls your tool with:

{
  "room_number": "B3",
  "date": "tomorrow",
  "start_time": "14:30",
  "duration_minutes": 90,
  "student_id": 20241234
}

Question: Identify the error(s) in the assistant's call given your tool definition. What would happen when your backend receives this call? How would you revise your tool definition's description to prevent this specific error?


What to Hand In

Submit a document with:

  1. Your complete JSON tool definition (formatted and valid JSON)
  2. Your answer to Part 2: the error(s), why they matter, and your revised description language

Test your definition by reading it aloud to a partner: would they be able to call the function correctly based only on your definition?

Open Claude Output Β· project