Skip to main content
Glama

get_xrefs_from

Extract cross-references from a specific address in IDA Pro to analyze code and data relationships during reverse engineering.

Instructions

Get cross-references from an address

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYesSource address to find references from
typeNoType of references to find (code, data, all)

Implementation Reference

  • The core handler function getXrefsFrom in IDARemoteClient that performs HTTP GET request to IDA Pro remote server 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()}`);
    }
  • MCP server tool handler for 'get_xrefs_from': validates arguments, calls ida.getXrefsFrom, formats and returns the 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,
            };
        }
  • TypeScript interface defining the input arguments for get_xrefs_from tool.
    interface GetXrefsFromArgs {
        address: string | number;
        type?: 'code' | 'data' | 'all';
    }
  • index.ts:391-407 (registration)
    Tool registration in ListTools response, including name, description, and 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'],
        },
    },
  • Validation helper function to check if arguments match GetXrefsFromArgs interface.
    const isValidGetXrefsFromArgs = (args: any): args is GetXrefsFromArgs => {
        return (
            typeof args === 'object' &&
            args !== null &&
            (typeof args.address === 'string' || typeof args.address === 'number')
        );
    };
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but offers minimal behavioral context. It states what the tool does but doesn't disclose important traits like whether this is a read-only operation, what format the cross-references are returned in, potential limitations (e.g., only within current module), or error conditions. The description is functional but lacks operational transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose with zero wasted words. It's appropriately sized for a simple lookup tool and front-loads the core functionality.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no annotations and no output schema, the description is insufficiently complete. It doesn't explain what cross-references are in this context (e.g., code calls, data accesses), what the return format looks like, or how results are structured. Given the technical nature of reverse engineering tools, more context about the output would be helpful.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so parameters are well-documented in the schema itself. The description adds no additional parameter semantics beyond implying the 'address' is a source and 'type' filters reference types. This meets the baseline for high schema coverage where the description doesn't need to compensate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Get' and the resource 'cross-references' from a specific source 'address', making the purpose understandable. It distinguishes from sibling 'get_xrefs_to' by specifying direction 'from', but doesn't fully differentiate from other analysis tools like 'get_functions' or 'get_disassembly' in terms of what cross-references provide.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided about when to use this tool versus alternatives like 'get_xrefs_to' (which presumably finds references to an address) or other analysis tools. The description implies usage for finding references from an address but doesn't specify scenarios, prerequisites, or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

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/fdrechsler/mcp-server-idapro'

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