Skip to main content
Glama

List running processes in WSL

list_processes
Read-only

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,
    			};
    		}
    	},
    );
Behavior3/5

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

The description adds minimal behavioral context beyond the annotations. The annotation 'readOnlyHint: true' already indicates this is a safe read operation. The description implies it lists processes but doesn't disclose details like output format, pagination, or performance characteristics. It doesn't contradict annotations, but offers little additional value.

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?

The description is extremely concise—a single sentence that directly states the tool's purpose without unnecessary words. It's front-loaded with the core functionality, making it efficient for quick comprehension. Every word earns its place, adhering to best practices for brevity.

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?

Given the tool's low complexity (one optional parameter) and the presence of annotations covering safety, the description is minimally adequate. However, without an output schema, it doesn't explain what the tool returns (e.g., process list format), leaving a gap in completeness. It relies heavily on structured data for 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?

With 100% schema description coverage, the input schema fully documents the optional 'filter' parameter. The description doesn't add any parameter semantics beyond what the schema provides, such as examples of filter usage or format. This meets the baseline for high schema coverage but doesn't enhance understanding.

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

Purpose2/5

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

Tautological: description restates name/title.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention scenarios where this is preferred over sibling tools like 'get_system_info' or 'execute_command', nor does it specify prerequisites or exclusions. This lack of context could lead to incorrect tool selection by an AI agent.

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

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