get_xrefs_from
Extract cross-references from a specified address in IDA Pro for binary analysis, supporting code, data, or all reference types.
Instructions
Get cross-references from an address
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| address | Yes | Source address to find references from | |
| type | No | Type of references to find (code, data, all) |
Implementation Reference
- index.ts:816-850 (handler)MCP server tool handler for 'get_xrefs_from': validates arguments, invokes ida.getXrefsFrom, formats and returns the cross-references result.case 'get_xrefs_from': if (!isValidGetXrefsFromArgs(request.params.arguments)) { throw new McpError( ErrorCode.InvalidParams, 'Invalid get xrefs from arguments' ); } try { const { address, type } = request.params.arguments; const result = await ida.getXrefsFrom(address, { type: type as 'code' | 'data' | 'all' }); return { content: [ { type: 'text', text: `Found ${result.count} references from ${result.address} (${result.name}):\n\n${JSON.stringify(result.xrefs, null, 2) }`, }, ], }; } catch (error: any) { return { content: [ { type: 'text', text: `Error getting xrefs from address: ${error.message || error}`, }, ], isError: true, }; }
- index.ts:390-407 (registration)Registration of the 'get_xrefs_from' tool in the MCP server's listTools response, defining name, description, and JSON input schema.{ name: 'get_xrefs_from', description: 'Get cross-references from an address', inputSchema: { type: 'object', properties: { address: { type: 'string', description: 'Source address to find references from', }, type: { type: 'string', description: 'Type of references to find (code, data, all)', }, }, required: ['address'], }, },
- index.ts:72-75 (schema)TypeScript interface defining the input shape for get_xrefs_from tool arguments, used for runtime validation.interface GetXrefsFromArgs { address: string | number; type?: 'code' | 'data' | 'all'; }
- idaremoteclient.ts:498-516 (helper)Core helper function in IDARemoteClient that constructs and sends HTTP GET request to IDA Pro remote control API endpoint /xrefs/from to retrieve cross-references from the given address.async getXrefsFrom( address: number | string, options: { type?: 'code' | 'data' | 'all'; } = {} ): Promise<XrefsResponse> { const params = new URLSearchParams(); const addr = typeof address === 'string' ? address : address.toString(); params.append('address', addr); if (options.type !== undefined) { params.append('type', options.type); } return this.get<XrefsResponse>(`/xrefs/from?${params.toString()}`); }
- idaremoteclient.ts:150-156 (schema)TypeScript interface defining the output response shape from getXrefsFrom, including count, list of xrefs, target address and name.export interface XrefsResponse { count: number; xrefs: XrefInfo[]; address: string; name: string; error?: string; }