Skip to main content
Glama

list_applications

Discover and display all applications installed in the /Applications folder on a Mac system using this command-line tool for quick access and organization.

Instructions

List all applications installed in the /Applications folder

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • tools.ts:38-47 (handler)
    The tool handler callback that calls the listApplications helper, formats the app list as a numbered string, and returns it as a text content result.
    cb: async () => { const apps = await listApplications(); const appListString = apps.reduce((acc, app, index) => { return `${acc}${index + 1}. ${app}\n`; }, ""); const toolResult: CallToolResult = { content: [{ type: "text", text: appListString }], }; return toolResult; },
  • tools.ts:9-9 (schema)
    Input schema for the list_applications tool (empty object as it requires no input parameters).
    export const ListApplicationsInputSchema = {};
  • tools.ts:103-107 (registration)
    Registration of the list_applications tool config (along with others) in the exported tools array.
    export const tools: ToolConfig<any>[] = [ listApplicationsConfig, launchAppConfig, openWithAppConfig, ];
  • Helper function imported and used by the tool handler to retrieve the list of .app files from /Applications directory.
    export async function listApplications(): Promise<string[]> { try { const files = await readdir("/Applications"); return files.filter((file) => file.endsWith(".app")).sort(); } catch (error) { console.error("Error listing applications:", error); return []; } }
  • tools.ts:27-48 (registration)
    Definition of the tool configuration object for list_applications, including name, description, annotations, schema reference, and inline handler callback.
    const listApplicationsConfig: ToolConfig<typeof ListApplicationsInputSchema> = { name: "list_applications", description: "List all applications installed in the /Applications folder", annotations: { title: "列出所有應用程式", readOnlyHint: true, // 只讀取應用程式列表,不修改系統 destructiveHint: false, // 不執行任何破壞性操作 idempotentHint: true, // 重複呼叫會得到相同結果(若應用程式列表未變) openWorldHint: false, // 只與本機檔案系統互動,不連接外部系統 }, schema: ListApplicationsInputSchema, cb: async () => { const apps = await listApplications(); const appListString = apps.reduce((acc, app, index) => { return `${acc}${index + 1}. ${app}\n`; }, ""); const toolResult: CallToolResult = { content: [{ type: "text", text: appListString }], }; return toolResult; }, };

Other Tools

Related 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/eugenechen0514/mac-apps-launcher'

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