get_account_list
Retrieve accounts available for login on a specific website. Input the domain name to access associated login credentials securely via the Authenticator App MCP Server.
Instructions
Retrieve the accounts can be used when logging into a website.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| website | Yes | The domain name of the website you need to login, e.g. "github.com" |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"website": {
"description": "The domain name of the website you need to login, e.g. \"github.com\"",
"type": "string"
}
},
"required": [
"website"
],
"type": "object"
}
Implementation Reference
- src/authenticator.ts:69-85 (handler)Core handler function that performs the HTTP request to retrieve the list of accounts for a given website from the backend API.async getAccountList(website: string): Promise<GetAccountListResponse> { const url = `${this.baseUrl}/account_list?website=${encodeURIComponent(website)}`; const response = await fetch(url, { headers: { Authorization: `Bearer ${this.accessToken}`, }, }); if (!response.ok) { const errorBody = await response.text(); console.error(`HTTP error ${response.status} from ${url}: ${errorBody}`); throw new Error(`HTTP error ${response.status}: ${errorBody}`); } // Assuming the backend returns a string array directly const accounts = (await response.json()) as string[]; return { accounts }; }
- src/mcp.ts:76-95 (registration)MCP tool registration for 'get_account_list', including Zod input schema, description, and handler function that delegates to Authenticator.this.tool( 'get_account_list', 'Retrieve the accounts can be used when logging into a website.', { website: z .string() .describe('The domain name of the website you need to login, e.g. "github.com"'), }, async ({ website }, extra) => { const res = await this.authenticator.getAccountList(website); return { content: [ { type: 'text', text: `The accounts are: ${res.accounts.join(', ')}.`, }, ], }; } );
- src/authenticator.ts:25-27 (schema)TypeScript interface defining the response structure for getAccountList.export interface GetAccountListResponse { accounts: string[]; }
- src/authenticator.ts:12-14 (schema)TypeScript interface defining the input parameters for getAccountList (matches the Zod schema).interface GetAccountListParams { website: string; }
- src/mcp.ts:84-94 (handler)MCP tool handler lambda that formats the response from authenticator.getAccountList.async ({ website }, extra) => { const res = await this.authenticator.getAccountList(website); return { content: [ { type: 'text', text: `The accounts are: ${res.accounts.join(', ')}.`, }, ], }; }