Skip to main content
Glama

pylon_get_account

Retrieve a specific account from the Pylon customer support platform by providing its unique ID or external identifier.

Instructions

Get a specific account by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe account ID or external ID

Implementation Reference

  • src/index.ts:62-74 (registration)
    Registers the pylon_get_account MCP tool, including input schema (id: string) and handler that calls PylonClient.getAccount and formats the response as text.
    server.tool(
    	'pylon_get_account',
    	'Get a specific account by ID',
    	{
    		id: z.string().describe('The account ID or external ID'),
    	},
    	async ({ id }) => {
    		const result = await client.getAccount(id);
    		return {
    			content: [{ type: 'text', text: JSON.stringify(result.data, null, 2) }],
    		};
    	},
    );
  • The core handler logic for retrieving an account via API GET request to /accounts/{id}, using the private request method.
    async getAccount(id: string): Promise<SingleResponse<Account>> {
    	return this.request<SingleResponse<Account>>('GET', `/accounts/${id}`);
    }
  • TypeScript interface defining the structure of an Account object returned by the Pylon API.
    export interface Account {
    	id: string;
    	name: string;
    	domains?: string[];
    	primary_domain?: string;
    	logo_url?: string;
    	owner_id?: string;
    	channels?: object[];
    	custom_fields?: object;
    	external_ids?: object[];
    	tags?: string[];
    }
  • Private helper method used by all client methods to perform authenticated HTTP requests to the Pylon API.
    private async request<T>(
    	method: string,
    	path: string,
    	body?: object,
    ): Promise<T> {
    	const url = `${PYLON_API_BASE}${path}`;
    	const headers: Record<string, string> = {
    		Authorization: `Bearer ${this.apiToken}`,
    		'Content-Type': 'application/json',
    		Accept: 'application/json',
    	};
    
    	const response = await fetch(url, {
    		method,
    		headers,
    		body: body ? JSON.stringify(body) : undefined,
    	});
    
    	if (!response.ok) {
    		const errorText = await response.text();
    		throw new Error(
    			`Pylon API error: ${response.status} ${response.statusText} - ${errorText}`,
    		);
    	}
    
    	return response.json() as Promise<T>;
    }

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/JustinBeckwith/pylon-mcp'

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