Skip to main content

Experiment Further

You now have a working Custom MCP Tool that an external MCP client can call against your Twinit data. Here are some ways to deepen your understanding and extend what you have built.

Experiment with the Tool#

Try asking your MCP client different questions and watch how it decides when to call GetCourseByTitle:

  • What is the API Design and Development course about?
  • Find the Data Science Fundamentals course and tell me who teaches it.
  • Look up "machine learning" and list every matching course.

Notice how the quality of the tool's _description and the field descriptions in the schema affect when and how reliably the model calls the tool. Try editing the description to be vaguer, then more specific, and observe the difference in behaviour.

Add Another Custom MCP Tool#

A single backend script can back multiple tools, and a project can have many tools. As an exercise, add a second function to the course-tools script, for example getCoursesByInstructor, and register it as a new Custom MCP Tool with its own schema. Then ask your MCP client a question that requires the new tool, such as "Which courses does Dr. Sarah Chen teach?".

Equip an Agent with the Tool#

Custom MCP Tools are not only for external MCP clients, you can also equip a Twinit AI Agent with a tool and use it inside a Team conversation, just as you did with system tools in the AI 02 course.

To do this:

  1. Create an Agent and add GetCourseByTitle to its tools.
  2. Use the Agent's _background to instruct it when to call the tool, for example: "When the user asks about a specific course, use the GetCourseByTitle tool to look it up and answer with the course details and instructor."
  3. Create a Team that includes the Agent, then start a conversation and ask about a course.

This shows the real power of Custom MCP Tools: the same tool, defined once, can be reused by external MCP clients, internal agents, and teams alike.

Where to Go Next#

  • Review the AI Service MCP documentation on twinit.dev to learn about System MCP Tools, MCP Tool Filters, and connecting the AI Service to external MCP servers.
  • Revisit the AI 02 | Twinit AI Hands On course to combine custom tools, knowledgebases, and multi-agent teams.