Skip to main content
Glama

wp_get_application_passwords

Retrieve application passwords for a WordPress user to manage API access and security permissions. Lists all assigned passwords for user authentication.

Instructions

Lists application passwords for a specific user.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
siteNoThe ID of the WordPress site to target (from mcp-wordpress.config.json). Required if multiple sites are configured.
user_idYesThe ID of the user to get application passwords for.

Implementation Reference

  • Registration of the wp_get_application_passwords tool including schema (parameters) in SiteTools.getTools()
    { name: "wp_get_application_passwords", description: "Lists application passwords for a specific user.", parameters: [ { name: "user_id", type: "number", required: true, description: "The ID of the user to get application passwords for.", }, ], handler: this.handleGetApplicationPasswords.bind(this), },
  • Handler function that executes the tool: extracts user_id, calls client.getApplicationPasswords, formats and returns the list of application passwords.
    public async handleGetApplicationPasswords( client: WordPressClient, params: Record<string, unknown>, ): Promise<unknown> { try { const { user_id } = params as { user_id: number }; const passwords = await client.getApplicationPasswords(user_id); if (passwords.length === 0) { return `No application passwords found for user ID ${user_id}.`; } const content = `Found ${passwords.length} application passwords for user ID ${user_id}:\n\n` + passwords .map( (p: WordPressApplicationPassword) => `- **${p.name}** (UUID: ${p.uuid})\n Created: ${new Date(p.created).toLocaleDateString()}`, ) .join("\n"); return content; } catch (_error) { throw new Error(`Failed to get application passwords: ${getErrorMessage(_error)}`); } }
  • Supporting method in SiteOperations that makes the actual REST API GET request to retrieve application passwords for the user.
    async getApplicationPasswords(userId: number | "me" = "me"): Promise<WordPressApplicationPassword[]> { return this.client.get<WordPressApplicationPassword[]>(`users/${userId}/application-passwords`); }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/docdyhr/mcp-wordpress'

If you have feedback or need assistance with the MCP directory API, please join our Discord server