How to query a name in a database using an MCP Server and an Agent Component
Learn how to build a small end-to-end integration where an Agent receives a name, calls an MCP tool, and retrieves the matching database record.
Step-by-step
2
8
Configure the Agent Component
You are a helpful assistant that can look up information about people in a database.
You have access to a tool named "search-people" that retrieves records based on a person's name.
When a user asks about someone, call the "search-people" tool with the correct name as the input.
If the tool returns data, summarize the main details clearly.Find information about {{ message.arguments.name }} in the database.9
10
Run the use case end-to-end
Inside the Execution Panel
{
"queryAndPath": {
"name": "João Souza"
}
}{
"body": {
"text": "João Souza is from Rio de Janeiro, RJ, Brazil. He lives on Rua Visconde de Pirajá, with the postal code 22410-003. His email address is [email protected]. His record was created on the database at a timestamp of 1718717592000 and has a due date of 1724112000000."
},
"tokenUsage": {
"inputTokenCount": 353,
"outputTokenCount": 98,
"totalTokenCount": 451
}
}In an API testing tool
{
"body": {
"text": "I found the following information about João Souza:\n\n- He lives in Rio de Janeiro, RJ, at Rua Visconde de Pirajá, CEP: 22410-003.\n- His email address is [email protected].\n- His record was created on the database at a timestamp of 1718717592000.\n- He has a due date recorded as 1724112000000.\n- His code in the database is 7676."
},
"tokenUsage": {
"inputTokenCount": 353,
"outputTokenCount": 118,
"totalTokenCount": 471
}
}Additional Agent configurations to improve accuracy
Last updated
Was this helpful?