Skip to main content
Glama

list_processes

View running processes in WSL environments to monitor system activity and identify specific applications using optional name filtering.

Instructions

List running processes in WSL

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filterNoFilter by name

Implementation Reference

  • Handler function that constructs a 'ps aux' command optionally filtered by process name using grep, executes it via command_executor, formats the output, and returns it in MCP format or an error response.
    async ({ filter }) => { try { const cmd = filter ? `ps aux | grep -i "${filter}" | grep -v grep` : 'ps aux'; const result = await this.command_executor.execute_command(cmd); return { content: [ { type: 'text' as const, text: this.format_output(result), }, ], }; } catch (error) { return { content: [ { type: 'text' as const, text: `Error: ${error instanceof Error ? error.message : String(error)}`, }, ], isError: true, }; } },
  • Valibot schema for input parameters: optional filter string to grep process names.
    schema: v.object({ filter: v.optional( v.pipe( v.string(), v.description('Filter by name'), ), ), }),
  • src/index.ts:187-229 (registration)
    MCP server tool registration including name, description, read-only annotation, input schema, and inline handler reference.
    this.server.tool( { name: 'list_processes', description: 'List running processes in WSL', schema: v.object({ filter: v.optional( v.pipe( v.string(), v.description('Filter by name'), ), ), }), annotations: { readOnlyHint: true, }, }, async ({ filter }) => { try { const cmd = filter ? `ps aux | grep -i "${filter}" | grep -v grep` : 'ps aux'; const result = await this.command_executor.execute_command(cmd); return { content: [ { type: 'text' as const, text: this.format_output(result), }, ], }; } catch (error) { return { content: [ { type: 'text' as const, text: `Error: ${error instanceof Error ? error.message : String(error)}`, }, ], isError: true, }; } }, );

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/spences10/mcp-wsl-exec'

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