# update_user

Update a database user for a Cloud SQL instance. A common use case for the update_user is to grant a user the cloudsqlsuperuser role, which can provide a user with many required permissions. This tool only supports updating users to assign database roles. * This tool returns a long-running operation. Use the get_operation tool to poll its status until the operation completes. * Before calling the update_user tool, always check the existing configuration of the user such as the user type with list_users tool. * As a special case for MySQL, if the list_users tool returns a full email address for the iamEmail field, for example {name=test-account, iamEmail=test-account@project-id.iam.gserviceaccount.com}, then in your update_user request, use the full email address in the iamEmail field in the name field of your toolrequest. For example, name=test-account@project-id.iam.gserviceaccount.com. Key parameters for updating user roles: * database_roles: A list of database roles to be assigned to the user. * revokeExistingRoles: A boolean field (default: false) that controls how existing roles are handled. How role updates work: 1. If revokeExistingRoles is true: * Any existing roles granted to the user but NOT in the provided database_roles list will be REVOKED. * Revoking only applies to non-system roles. System roles like cloudsqliamuser etc won't be revoked. * Any roles in the database_roles list that the user does NOT already have will be GRANTED. * If database_roles is empty, then ALL existing non-system roles are revoked. 2. If revokeExistingRoles is false (default): * Any roles in the database_roles list that the user does NOT already have will be GRANTED. * Existing roles NOT in the database_roles list are KEPT. * If database_roles is empty, then there is no change to the user's roles. Examples: * Existing Roles: [roleA, roleB] * Request: database_roles: [roleB, roleC], revokeExistingRoles: true * Result: Revokes roleA, Grants roleC. User roles become [roleB, roleC]. * Request: database_roles: [roleB, roleC], revokeExistingRoles: false * Result: Grants roleC. User roles become [roleA, roleB, roleC]. * Request: database_roles: [], revokeExistingRoles: true * Result: Revokes roleA, Revokes roleB. User roles become []. * Request: database_roles: [], revokeExistingRoles: false * Result: No change. User roles remain [roleA, roleB].

Agent View of the PolicyLayer registry record for `update_user`. HTML page: https://policylayer.com/tools/com-googleapis-sqladmin-mcp/update-user

## Facts

- Tool: `update_user`
- Server: Mcp (`https://sqladmin.googleapis.com/mcp`) — https://policylayer.com/tools/com-googleapis-sqladmin-mcp.md
- Homepage: https://github.com/https://sqladmin.googleapis.com/mcp
- Risk category: Write (Medium risk)
- Registry record: grade F, identity unverified
- Server auth posture: open
- Server rate-limited: no
- Parameters: 7 (4 required)
- Recommended policy verdict: Rate-limited

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `host` | string | no | Optional. Host of the user in the instance. |
| `name` | string | yes | Required. Name of the user in the instance. |
| `type` | string | yes | Required. The user type. It determines the method to authenticate the user during login. The default is the database's built-in user type. |
| `project` | string | yes | Required. Project ID of the project that contains the instance. |
| `instance` | string | yes | Required. Database instance ID. This does not include the project ID. |
| `databaseRoles` | array | no | Optional. List of database roles to grant to the user. body.database_roles will be ignored for update request. |
| `revokeExistingRoles` | boolean | no | Optional. revoke the existing roles granted to the user. |

Parameters from the server's own tool schema.

## Example call (MCP tools/call, JSON-RPC 2.0)

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "update_user",
    "arguments": {
      "name": "<name>",
      "type": "<type>",
      "project": "<project>",
      "instance": "<instance>"
    }
  }
}
```

## Why update_user is rated Medium

An AI agent can call update_user faster than any human can review: one bad instruction and it creates or modifies resources in Mcp by the hundred, each call as confident as the last.

Risk signals: Accepts URL/endpoint input (host)

## Use case

AI agents use update_user to create or update resources in Mcp, usually the action step of a workflow, after the agent has gathered context. Every call changes real data in your Mcp environment.

## Recommended policy (PolicyLayer)

Verdict: **Rate-limited**. Enforced by the PolicyLayer MCP gateway (https://policylayer.com/mcp-gateway) before a call reaches Mcp:

```json
{
  "version": "1",
  "default": "deny",
  "tools": {
    "update_user": {
      "limits": [
        {
          "counter": "update_user_rate",
          "window": "minute",
          "max": 30,
          "scope": "grant"
        }
      ]
    }
  }
}
```

## Other tools on Mcp (14)

- `execute_sql` — Execute — https://policylayer.com/tools/com-googleapis-sqladmin-mcp/execute-sql.md
- `execute_sql_readonly` — Execute — https://policylayer.com/tools/com-googleapis-sqladmin-mcp/execute-sql-readonly.md
- `postgres_upgrade_precheck` — Execute — https://policylayer.com/tools/com-googleapis-sqladmin-mcp/postgres-upgrade-precheck.md
- `get_instance` — Read — https://policylayer.com/tools/com-googleapis-sqladmin-mcp/get-instance.md
- `get_operation` — Read — https://policylayer.com/tools/com-googleapis-sqladmin-mcp/get-operation.md
- `list_instances` — Read — https://policylayer.com/tools/com-googleapis-sqladmin-mcp/list-instances.md
- `list_users` — Read — https://policylayer.com/tools/com-googleapis-sqladmin-mcp/list-users.md
- `clone_instance` — Write — https://policylayer.com/tools/com-googleapis-sqladmin-mcp/clone-instance.md
- `create_backup` — Write — https://policylayer.com/tools/com-googleapis-sqladmin-mcp/create-backup.md
- `create_instance` — Write — https://policylayer.com/tools/com-googleapis-sqladmin-mcp/create-instance.md
- `create_user` — Write — https://policylayer.com/tools/com-googleapis-sqladmin-mcp/create-user.md
- `import_data` — Write — https://policylayer.com/tools/com-googleapis-sqladmin-mcp/import-data.md
- `restore_backup` — Write — https://policylayer.com/tools/com-googleapis-sqladmin-mcp/restore-backup.md
- `update_instance` — Write — https://policylayer.com/tools/com-googleapis-sqladmin-mcp/update-instance.md

## For agents

This record is a snapshot. Live verdicts and the full registry:

- Check every server in your MCP config at once: `npx -y policylayer stack`
- Vet a server before you add it: install the mcp-precheck skill — `npx skills add https://policylayer.com` (skill text: https://policylayer.com/skill.md)
- Query the registry over MCP: endpoint `https://api.policylayer.com/mcp` — tools `check_mcp_server`, `check_mcp_stack`, `check_tool`, `search_registry`, `get_change_events`

---

Source: the PolicyLayer MCP registry — one continuously verified record per MCP server. Full record: https://policylayer.com/registry?q=com-googleapis-sqladmin-mcp · API: https://policylayer.com/registry/api · Policy library: https://policylayer.com/policies/com-googleapis-sqladmin-mcp
