Skip to main content
Glama

get_xrefs_to

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

Instructions

Get cross-references to an address

Input Schema

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

Implementation Reference

  • MCP tool handler for 'get_xrefs_to': validates input, calls IDARemoteClient.getXrefsTo, formats and returns the response.
    case 'get_xrefs_to':
        if (!isValidGetXrefsToArgs(request.params.arguments)) {
            throw new McpError(
                ErrorCode.InvalidParams,
                'Invalid get xrefs to arguments'
            );
        }
    
        try {
            const { address, type } = request.params.arguments;
    
            const result = await ida.getXrefsTo(address, {
                type: type as 'code' | 'data' | 'all'
            });
    
            return {
                content: [
                    {
                        type: 'text',
                        text: `Found ${result.count} references to ${result.address} (${result.name}):\n\n${JSON.stringify(result.xrefs, null, 2)
                            }`,
                    },
                ],
            };
        } catch (error: any) {
            return {
                content: [
                    {
                        type: 'text',
                        text: `Error getting xrefs to address: ${error.message || error}`,
                    },
                ],
                isError: true,
            };
        }
  • TypeScript interface defining the input arguments for the get_xrefs_to tool.
    interface GetXrefsToArgs {
        address: string | number;
        type?: 'code' | 'data' | 'all';
    }
  • index.ts:372-389 (registration)
    Registration of the 'get_xrefs_to' tool in the MCP server, including name, description, and input schema.
    {
        name: 'get_xrefs_to',
        description: 'Get cross-references to an address',
        inputSchema: {
            type: 'object',
            properties: {
                address: {
                    type: 'string',
                    description: 'Target address to find references to',
                },
                type: {
                    type: 'string',
                    description: 'Type of references to find (code, data, all)',
                },
            },
            required: ['address'],
        },
    },
  • IDARemoteClient helper method that performs HTTP GET to the IDA Pro server /xrefs/to endpoint to fetch cross-references.
    async getXrefsTo(
        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/to?${params.toString()}`);
    }
  • Type guard function to validate input arguments for get_xrefs_to tool.
    const isValidGetXrefsToArgs = (args: any): args is GetXrefsToArgs => {
        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?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action but doesn't describe what 'cross-references' entail (e.g., format, scope, or limitations), whether it's read-only or has side effects, or any performance considerations like rate limits.

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 with no wasted words. It's front-loaded with the core action and resource, making it easy to parse quickly, which is ideal for conciseness.

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?

Given no annotations and no output schema, the description is incomplete. It lacks details on what 'cross-references' means, the return format, or any behavioral traits, which is insufficient for a tool with parameters and siblings, especially in a context like IDA analysis where clarity is critical.

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?

The schema description coverage is 100%, with both parameters ('address' and 'type') documented in the schema. The description adds no additional meaning beyond implying the tool finds references to an address, which aligns with the schema but doesn't enhance parameter understanding, meeting the baseline for high schema coverage.

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 action ('Get cross-references') and the target resource ('to an address'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'get_xrefs_from' or explain what 'cross-references' means in this context, which prevents a perfect score.

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 on when to use this tool versus alternatives. With sibling tools like 'get_xrefs_from' (likely for references from an address), the description doesn't clarify the distinction or suggest any prerequisites, leaving usage context unclear.

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