Skip to main content
Glama

pylon_create_account

Create a new account in the Pylon customer support platform by specifying account name, domains, owner, and tags for organization management.

Instructions

Create a new account in Pylon

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesThe name of the account
domainsNoList of domains associated with the account
primary_domainNoPrimary domain
logo_urlNoURL of the account logo
owner_idNoID of the account owner
tagsNoTags to apply to the account

Implementation Reference

  • src/index.ts:76-99 (registration)
    MCP tool registration for 'pylon_create_account', including input schema with Zod validation and the handler function that delegates to PylonClient.createAccount and formats the response.
    server.tool(
    	'pylon_create_account',
    	'Create a new account in Pylon',
    	{
    		name: z.string().describe('The name of the account'),
    		domains: z
    			.array(z.string())
    			.optional()
    			.describe('List of domains associated with the account'),
    		primary_domain: z.string().optional().describe('Primary domain'),
    		logo_url: z.string().optional().describe('URL of the account logo'),
    		owner_id: z.string().optional().describe('ID of the account owner'),
    		tags: z
    			.array(z.string())
    			.optional()
    			.describe('Tags to apply to the account'),
    	},
    	async (params) => {
    		const result = await client.createAccount(params);
    		return {
    			content: [{ type: 'text', text: JSON.stringify(result.data, null, 2) }],
    		};
    	},
    );
  • Core handler logic in PylonClient for creating an account via POST request to the Pylon API /accounts endpoint.
    async createAccount(
    	data: Partial<Account> & { name: string },
    ): Promise<SingleResponse<Account>> {
    	return this.request<SingleResponse<Account>>('POST', '/accounts', data);
    }
  • TypeScript interface defining the structure of an Account object, used for typing the createAccount parameters and response.
    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[];
    }
  • Generic private request method in PylonClient that handles all HTTP API calls, including authentication and error handling, used by createAccount.
    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