1. Học hỏi
  2. /
  3. Khoa Học
  4. /
  5. Introduction to Model Context Protocol (MCP)

Connected

Bài tập

Adding Docstrings and Type Hints

Time to make your convert_currency() tool easier for LLMs to use through docstrings and type hints. Without this, the LLM may not be able to effectively choose which tool to call, or may pass values to the arguments incorrectly—both of which result in unreliable application performance!

An MCP server has already been instantiated using FastMCP and assigned to mcp.

Hướng dẫn

100 XP
  • Add appropriate types to the function arguments and return object.
  • Complete the docstring to match the three function arguments with their definitions.