update_employee
Modify employee records by updating name, age, or other details using the MCP Employee API Server's REST API. This tool allows AI assistants to change existing employee information.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"id": "<id>",
"name": "<name>",
"age": "<age>"
},
"name": "update_employee"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| name | Yes | ||
| age | Yes |
Implementation Reference
- main.py:64-71 (handler)The handler function for the 'update_employee' tool. It is registered via the @mcp.tool() decorator and performs a PUT request to update an employee's name and age by ID using the shared make_request helper.
@mcp.tool() async def update_employee(id: int, name: str, age: int) -> dict: url = f"{URL_BASE}/employees/{id}" response = await make_request(url, "PUT", { "name": name, "age": age }) return response