From the course: Hands-On AI: Building AI Agents with Model Context Protocol (MCP) and Agent2Agent (A2A)

HR timeoff agent design

- [Instructor] In this chapter, we will build another MCP-based agent called HR time off agent. This agent will exercise additional capabilities with MCP and will be integrated into a multi-agent system in chapter six. First, let's discuss the functionality provided by the time off agent. Enterprises need to manage time off requests from employees, like sick days, vacation days, and other special time offs. A HR time off agent helps employees manage their time offs. It provides them the ability to file new time off requests, as well as query for their time off balances. Time off data is managed in a SQLite database for this exercise. For simplicity's sake, we will only manage one type of time off. We will use an MCP server to provide, create, and retrieve operations on time off data. In addition, the prompt for the agent will also be served by the MCP server. The client, HR time off agent, will use the tools provided by this MCP server to file new time off requests and provide time off balances. What does the design of this time off agent look like? We have time off data stored in a SQLite database. In real-world situations, this would be in a scaled and managed database. A HR time off server provides MCP services for the system. It has two tools, namely, get time off balance and request time off. These tools help to get the current time off balance for an employee in the SQLite database, and also update time off balance based on new requests, respectively. The system prompt template is also served by this MCP server. The HR time off agent is an application that provides time off management services to the users. In addition to its agentic capabilities, it also has an MCP client. The MCP client communicates with the HR time off MCP server for time off management. Note that this will use the HTTP/SSE for communication. Unlike the previous examples with SGBAO, where the server is started by the client, here, the server should be up and running for the client to communicate using HTTP. Let's now proceed to implement this example in the rest of the chapter.

Contents