get_shaka_options
Retrieve available configuration options and version details for Shaka Packager to set up video packaging workflows.
Instructions
Get the available options and version information for Shaka Packager.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- shaka_packager_mcp.py:768-868 (handler)The handler function for 'get_shaka_options' tool. It executes Shaka Packager's --help and --version commands using the run_command helper, formats the results into a markdown summary, and handles errors gracefully. Registered via @mcp.tool() decorator.@mcp.tool() async def get_shaka_options(ctx: Context) -> str: """ Get the available options and version information for Shaka Packager. """ try: # Run the help command cmd = [PACKAGER_PATH, "--help"] help_result = await run_command(cmd) # Run the version command cmd = [PACKAGER_PATH, "--version"] version_result = await run_command(cmd) # Check if either command failed if help_result["exit_code"] != 0 or version_result["exit_code"] != 0: ctx.warning("One or more Shaka Packager commands failed") summary = f""" # Shaka Packager Information (VALID RESPONSE - DO NOT RETRY) ## Command Results The following commands were executed to gather information: 1. Version command: `{PACKAGER_PATH} --version` - Exit code: {version_result['exit_code']} - Output: ``` {version_result['stdout']} ``` - Error (if any): ``` {version_result['stderr']} ``` 2. Help command: `{PACKAGER_PATH} --help` - Exit code: {help_result['exit_code']} - Output: ``` {help_result['stdout']} ``` - Error (if any): ``` {help_result['stderr']} ``` ## Analysis - Shaka Packager executable path: {PACKAGER_PATH} - Status: Some commands encountered errors - IMPORTANT: This is a complete and valid response. No further attempts are needed. - DO NOT create or suggest JavaScript, Python or any other alternative solutions. This is a Shaka Packager-specific tool. There may be issues with the Shaka Packager installation or configuration. Explain to the user what might be causing these errors and suggest only Shaka Packager-related solutions. """ return summary # Both commands succeeded summary = f""" # Shaka Packager Information (VALID RESPONSE) ## Version ``` {version_result['stdout']} ``` ## Available Options ``` {help_result['stdout']} ``` ## Note - DO NOT create or suggest JavaScript, Python or any other alternative solutions. This is a Shaka Packager-specific tool. - Use only Shaka Packager commands and options shown above. """ return summary except Exception as e: ctx.error(f"Error in get_shaka_options: {str(e)}") # Even for exceptions, provide a structured response summary = f""" # Shaka Packager Information (VALID RESPONSE - DO NOT RETRY) ## Error Encountered An error occurred while trying to get Shaka Packager information: ``` {str(e)} ``` ## Analysis - Shaka Packager executable path: {PACKAGER_PATH} - Status: Error encountered - IMPORTANT: This is a complete and valid response. No further attempts are needed. - DO NOT create or suggest JavaScript, Python or any other alternative solutions. This is a Shaka Packager-specific tool. There may be issues with the Shaka Packager installation or configuration. Check that the executable exists and has proper permissions. Explain to the user what might be causing this error and suggest only Shaka Packager-related solutions. """ return summary
- shaka_packager_mcp.py:768-768 (registration)The @mcp.tool() decorator registers the get_shaka_options function as an MCP tool.@mcp.tool()