Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
lima-vm
GitHub Repository: lima-vm/lima
Path: blob/master/pkg/mcp/msi/shell.go
2608 views
1
// SPDX-FileCopyrightText: Copyright The Lima Authors
2
// SPDX-License-Identifier: Apache-2.0
3
4
// Portion of AI prompt texts from:
5
// - https://github.com/google-gemini/gemini-cli/blob/v0.1.12/docs/tools/shell.md
6
//
7
// SPDX-FileCopyrightText: Copyright 2025 Google LLC
8
9
package msi
10
11
import "github.com/modelcontextprotocol/go-sdk/mcp"
12
13
var RunShellCommand = &mcp.Tool{
14
Name: "run_shell_command",
15
Description: `Executes a given shell command.`,
16
}
17
18
type RunShellCommandParams struct {
19
Command []string `json:"command" jsonschema:"The exact shell command to execute. Defined as a string slice, unlike Gemini's run_shell_command that defines it as a single string."`
20
Description string `json:"description,omitempty" jsonschema:"A brief description of the command's purpose, which will be potentially shown to the user."`
21
Directory string `json:"directory" jsonschema:"The absolute directory in which to execute the command. Unlike Gemini's run_shell_command, this must not be a relative path, and must not be empty."`
22
}
23
24
type RunShellCommandResult struct {
25
Stdout string `json:"stdout" jsonschema:"Output from the standard output stream."`
26
Stderr string `json:"stderr" jsonschema:"Output from the standard error stream."`
27
Error string `json:"error,omitempty" jsonschema:"Any error message reported by the subprocess."`
28
ExitCode *int `json:"exit_code,omitempty" jsonschema:"Exit code of the command."`
29
}
30
31