get_opcode_documentation
Retrieve detailed documentation for a specific opcode within a given instruction set, helping users understand its functionality and usage in code.
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)The main MCP tool handler for get_opcode_documentation. It delegates to the CompilerExplorerClient and removes the 'html' key from the 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 HTTP GET request to the Compiler Explorer API 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}" )