Tools, Function Calling, and MCP

Add validated domain tools, controlled actions, and a local MCP server to the project.

Previous · Course overview · Next

Assignment

Let your agent gather information and change local project state safely. Continue in the repository created from the course template and:

  1. Design at least three tools useful in your domain: one read-only tool, one reversible state-changing tool, and one sensitive tool that requires human confirmation, such as delete, overwrite, submit, or send.
  2. Give every tool a clear description, typed arguments, and a structured success or error result.
  3. Validate the tool name, arguments, permissions, and confirmation before invoking the domain operation.
  4. Expose at least two tools through a local MCP server. The normal and MCP paths must reuse the same domain implementation.
  5. Update the agent loop so the model can choose and combine these tools.

Demonstrate a goal requiring at least two tool decisions. A result such as “already exists,” “not found,” or “confirmation required” must be able to change the next action. Directly calling tools in a fixed script, or trusting the model to confirm its own sensitive action, does not satisfy the assignment.

Example

Example tool-using agent workflow

Your tools should represent your own project’s actions rather than copying the reading-queue example.

Deliverables

  • At least three typed, domain-specific tools.
  • Validation, permissions, and confirmation enforced outside the model.
  • At least two tools exposed through a local MCP server.
  • An agent run in which a tool observation changes the next action.
  • Deterministic success and failure tests.
  • Representative traces and a small trust-boundary diagram.
  • Updated project documentation.

Useful Materials