Skip to main content
Glama
opensensor

Binary Ninja Cline MCP Server

by opensensor

list_functions

Extract and display function names from binary files to analyze program structure and identify key components.

Instructions

List functions in a binary

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes

Implementation Reference

  • MCP CallToolRequest handler case for list_functions tool: parses input arguments using FilePathSchema and calls the Binary Ninja HTTP server.
    case "list_functions": {
      try {
        const args = FilePathSchema.parse(request.params.arguments);
        result = await callBinaryNinjaServer("list_functions", args);
      } catch (error) {
        console.error(`[ERROR] Failed to parse arguments for list_functions: ${error.message}`);
        console.error(`[ERROR] Arguments received: ${JSON.stringify(request.params.arguments)}`);
        throw error;
      }
      break;
  • Tool registration entry in ListTools response: defines name, description, and inputSchema for list_functions.
      name: "list_functions",
      description: "List functions in a binary",
      inputSchema: zodToJsonSchema(FilePathSchema),
    },
  • Zod schema defining the input parameters for list_functions tool: requires a non-empty 'path' string.
    const FilePathSchema = z.object({
      path: z.string().min(1, "File path cannot be empty")
    });
  • Intermediate HTTP server handler for list_functions method: extracts path param, calls BinaryNinjaHTTPClient.list_functions, extracts and returns function names.
    elif method == "list_functions":
        path = params.get("path")
        if not path:
            return {"error": "Path parameter is required"}
            
        functions = client.list_functions(path)
        func_names = [f["name"] for f in functions]
        return {"result": func_names}
  • Core implementation: paginates requests to Binary Ninja HTTP API /functions endpoint (offset/limit) to retrieve all functions from the loaded binary.
    def list_functions(self, file_path=None):
        """List all functions in the currently open binary file."""
        try:
            # Get all functions with pagination
            all_functions = []
            offset = 0
            limit = 100
            
            while True:
                response = self._request('GET', 'functions', params={"offset": offset, "limit": limit})
                functions = response.get("functions", [])
                
                if not functions:
                    break
                    
                all_functions.extend(functions)
                
                # If we got fewer functions than the limit, we've reached the end
                if len(functions) < limit:
                    break
                    
                # Move to the next page
                offset += limit
                
            logger.info(f"Retrieved {len(all_functions)} functions in total")
            return all_functions
        except Exception as e:
            logger.error(f"Failed to list functions: {e}")
            raise
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action ('List functions') but lacks details on traits such as whether it's read-only (likely, but not confirmed), performance characteristics (e.g., speed for large binaries), error handling (e.g., invalid path), or output format (e.g., list of names, addresses). This leaves significant gaps for an agent to understand how the tool behaves.

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 without unnecessary words. It's front-loaded with the core action and resource, making it easy to parse. Every part of the sentence earns its place by conveying essential information concisely.

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 the complexity (binary analysis tool), no annotations, no output schema, and low schema coverage, the description is incomplete. It doesn't cover behavioral aspects like safety (read-only vs. destructive), output details (what 'list' returns), or error conditions. For a tool interacting with binaries, more context is needed to ensure proper usage by an agent.

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

Parameters2/5

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

The input schema has 1 parameter ('path') with 0% description coverage, so the description must compensate. However, it adds no meaning beyond the schema—it doesn't explain what 'path' refers to (e.g., file path to binary, URL), expected format, or constraints (e.g., must be local file). This fails to address the low schema coverage, resulting in inadequate parameter documentation.

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 ('List') and target resource ('functions in a binary'), making the purpose immediately understandable. It distinguishes itself from siblings like 'decompile_function' or 'disassemble_function' by focusing on listing rather than analyzing individual functions. However, it doesn't specify what kind of functions (e.g., exported, all, by section) or the format of the listing, keeping it from 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 explicit guidance is provided on when to use this tool versus alternatives. While the description implies it's for listing functions, it doesn't mention prerequisites (e.g., binary must be executable), exclusions (e.g., not for source code), or direct comparisons to siblings like 'get_binary_info' for broader metadata. Usage is implied but not clearly defined.

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/opensensor/bn_cline_mcp'

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