Skip to main content
Glama

pylon_list_accounts

Retrieve a paginated compact list of accounts, showing essential fields. Use the detail tool for full account information.

Instructions

List accounts. Returns compact table. Use pylon_get_account for details.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoNumber of accounts to return (1-100, default 50)
cursorNoPagination cursor for next page

Implementation Reference

  • The tool registration and handler for 'pylon_list_accounts' on the McpServer. Calls client.listAccounts() with optional limit/cursor, transforms results to minimal format via toAccountMinimal(), formats as a markdown table via formatAccountsAsTable(), and appends pagination info.
    server.tool(
    	'pylon_list_accounts',
    	'List accounts. Returns compact table. Use pylon_get_account for details.',
    	{
    		limit: z
    			.number()
    			.min(1)
    			.max(MAX_LIST_LIMIT)
    			.optional()
    			.describe(
    				`Number of accounts to return (1-${MAX_LIST_LIMIT}, default ${DEFAULT_LIST_LIMIT})`,
    			),
    		cursor: z.string().optional().describe('Pagination cursor for next page'),
    	},
    	async ({ limit, cursor }) => {
    		const result = await client.listAccounts({
    			limit: limit ?? DEFAULT_LIST_LIMIT,
    			cursor,
    		});
    
    		// Transform to minimal format to reduce context size
    		const accounts = result.data.map((raw) =>
    			toAccountMinimal(raw as unknown as Record<string, unknown>),
    		);
    
    		const table = formatAccountsAsTable(accounts);
    		const pagination = result.pagination.has_next_page
    			? `\n\nMore results available. Use cursor: "${result.pagination.cursor}"`
    			: '';
    
    		return {
    			content: [{ type: 'text', text: table + pagination }],
    		};
    	},
    );
  • Zod schema for AccountMinimal, defining the shape returned by the tool: id, name, primary_domain, owner_id, tags.
    export const AccountMinimalSchema = z.object({
    	id: z.string(),
    	name: z.string(),
    	primary_domain: z.string().nullable().optional(),
    	owner_id: z.string().nullable().optional(),
    	tags: z.array(z.string()).nullable().optional(),
    });
  • AccountStandardSchema extends AccountMinimalSchema with additional fields (domains, created_at, type).
    export const AccountStandardSchema = AccountMinimalSchema.extend({
    	domains: z.array(z.string()).nullable().optional(),
    	created_at: z.string().optional(),
    	type: z.string().optional(),
    });
    
    export type AccountMinimal = z.infer<typeof AccountMinimalSchema>;
    export type AccountStandard = z.infer<typeof AccountStandardSchema>;
  • Helper function formatAccountsAsTable that formats AccountMinimal[] into a markdown table with columns ID, Name, Domain, Tags.
    function formatAccountsAsTable(accounts: AccountMinimal[]): string {
    	if (accounts.length === 0) {
    		return 'No accounts found.';
    	}
    
    	const headers = ['ID', 'Name', 'Domain', 'Tags'];
    	const rows = accounts.map((account) => [
    		escapeCell(account.id),
    		escapeCell(truncate(account.name, MAX_NAME_LENGTH)),
    		escapeCell(account.primary_domain || '-'),
    		escapeCell((account.tags || []).slice(0, 3).join(', ') || '-'),
    	]);
    
    	const headerRow = `| ${headers.join(' | ')} |`;
    	const separatorRow = `|${headers.map(() => '---').join('|')}|`;
    	const dataRows = rows.map((row) => `| ${row.join(' | ')} |`).join('\n');
    
    	return `${headerRow}\n${separatorRow}\n${dataRows}`;
    }
  • Helper function toAccountMinimal that transforms a raw API response object into an AccountMinimal object.
    export function toAccountMinimal(raw: Record<string, unknown>): AccountMinimal {
    	const owner = raw['owner'] as { id?: string } | null | undefined;
    	return {
    		id: raw['id'] as string,
    		name: raw['name'] as string,
    		primary_domain: raw['primary_domain'] as string | null | undefined,
    		owner_id: owner?.id ?? (raw['owner_id'] as string | null | undefined),
    		tags: raw['tags'] as string[] | null | undefined,
    	};
    }
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, but description includes that it returns a compact table, implying a read operation with limited fields. Could mention pagination or default behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three short sentences: purpose, output nature, usage guidance. No waste, front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema, so 'compact table' is vague. Could specify fields or sorting. Adequate for a list tool but minimal context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema covers both parameters with descriptions (limit and cursor), and the description adds no extra parameter context. Baseline 3 for 100% coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states the tool lists accounts and returns a compact table, distinguishing from pylon_get_account which provides details.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly directs users to use pylon_get_account for details, implying this tool is for high-level overviews. Does not exhaustively cover when not to use, but adequate.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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