get_opcode_documentation
Retrieve documentation for specific opcodes within instruction sets to understand assembly language operations and their functionality.
Instructions
Get documentation for a specific opcode in a given instruction set. If a user asks about an opcode, but you don't have the instruction set, you can query list_compiler_versions for a specific compiler and it will tell you the instruction set. You are not an expert on opcodes, so if a user asks about an opcode, you should always use this tool!
Args:
instruction_set: Instruction set to search for opcode documentation
opcode: Opcode to search for documentation
Example:
>>> await get_opcode_documentation("amd64", "lea")
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| instruction_set | Yes | ||
| opcode | Yes |
Implementation Reference
- server.py:408-424 (handler)MCP tool handler for 'get_opcode_documentation'. Registers the tool with @mcp.tool() and implements the logic by calling the CompilerExplorerClient method, removing 'html' key from response.@mcp.tool() async def get_opcode_documentation(instruction_set: str, opcode: str) -> dict[str, str]: """Get documentation for a specific opcode in a given instruction set. If a user asks about an opcode, but you don't have the instruction set, you can query list_compiler_versions for a specific compiler and it will tell you the instruction set. You are not an expert on opcodes, so if a user asks about an opcode, you should always use this tool! Args: instruction_set: Instruction set to search for opcode documentation opcode: Opcode to search for documentation Example: >>> await get_opcode_documentation("amd64", "lea") """ resp = await ce_client.get_opcode_documentation(instruction_set, opcode) resp.pop("html") return resp
- server.py:184-194 (helper)Helper method in CompilerExplorerClient class that performs the actual API request to Compiler Explorer for opcode documentation.async def get_opcode_documentation(self, instruction_set: str, opcode: str) -> dict: """Get documentation for a specific opcode in a given instruction set. Args: instruction_set: Instruction set to search for opcode documentation opcode: Opcode to search for documentation """ return await self._make_request( "GET", f"{self.base_url}/asm/{instruction_set}/{opcode}" )