Week 3: Tool Use and Function Calling

MCP protocol, OpenAI/Anthropic APIs, tool design

Week 3 of 12

Learning Objectives

  • Implement MCP tools using Python SDK
  • Compare OpenAI and Anthropic function calling
  • Design effective tool schemas

Topics Covered

  • Model Context Protocol (MCP)
  • OpenAI function calling API
  • Anthropic tool use API
  • Tool design best practices

Resources

Jupyter Notebooks

Open MCP Tool Implementation in Colab MCP Tool Implementation Open Function Calling Comparison in Colab Function Calling Comparison

Required Readings

PaperAuthorsYearLink
Toolformer: Language Models Can Teach Themselves to Use Tools Schick et al. 2023 arXiv
Gorilla: Large Language Model Connected with APIs Patil et al. 2023 arXiv

Reading Guide: Toolformer Paper

2-3 hours Tool learning Self-supervised training API integration

Study of self-supervised tool learning in language models

Primary Paper

Toolformer: Language Models Can Teach Themselves to Use Tools
Schick, T., Dwivedi-Yu, J., et al. (2023)
NeurIPS 2023 arXiv

Exercise: Tool Design

100 Points 4-6 hours Advanced

Design and implement MCP tools for agent use

Learning Objectives

  • Create: Design effective tool schemas
  • Apply: Implement MCP tools using Python SDK
  • Analyze: Compare OpenAI and Anthropic APIs

Tasks

TaskPointsDescription
Tool Schema Design 25 Design JSON schemas for 3 tools
MCP Implementation 40 Implement tools using MCP SDK
API Comparison 35 Compare function calling across providers

Exercise

Build a multi-tool agent that can:

  1. Search the web for information
  2. Perform calculations
  3. Look up weather data
  4. Decide which tool to use based on the query

Discussion Questions

  1. How do OpenAI and Anthropic function calling APIs differ?
  2. What makes a good tool description?
  3. How should agents handle tool errors?

Additional Resources

Discussion & Questions

Join the Conversation

Have questions about this week's material? Want to discuss concepts with fellow students?



Back to top