Skip to main content
Glama
by microsoft
cli_wrapper-example.genai.js981 B
script({ title: "CLI Wrapper with Timeout and Type Annotations", description: "Generate a Python wrapper function to call a CLI tool.", system: ["system", "system.files", "system.python"] }) def("CLI", env.files) $`# Python CLI Wrapper This script will generate a Python wrapper function to call a CLI tool. The wrapper will include Pylance type annotations and handle optional arguments for each CLI option. Document each option. Additionally, the script will implement a timeout mechanism for the CLI invocation. ## Requirements - Python 3.x - subprocess module - typing module (for type annotations) - use a class to wrap functions - function name should match command name - generate wrappers for ALL commands and you shall be rewarded with a cookie ## Usage To use the generated wrapper, import the module and call the function with the appropriate arguments. The function will return the CLI output or raise an exception if the CLI call fails or times out. `

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/microsoft/genaiscript'

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