Skip to content

extract_symbolsmcp tool does not detect JavaScript arrow functions #168

@mandipportpro

Description

@mandipportpro

The extract_symbols MCP tool currently only detects functions declared with the function keyword. It fails to identify arrow functions, which are widely used in modern JavaScript/TypeScript codebases.
Current Behavior:
The tool only returns symbols for traditional function declarations:

// ✅ Detected
function handleSubmit(data) {
  // ...
}

// ❌ Not detected
const handleSubmit = (data) => {
  // ...
};

// ❌ Not detected
const fetchData = async (url) => {
  // ...
};

// ❌ Not detected (object method shorthand)
const api = {
  getData: () => { ... },
  postData: async (payload) => { ... }
};

Expected Behavior:

extract_symbols should detect all function-like declarations including:

  • Arrow functions assigned to variables (const fn = () => {})
  • Async arrow functions (const fn = async () => {})
  • Arrow functions as object properties
  • Arrow functions as class properties
  • Exported arrow functions (export const fn = () => {})

Impact:

This limitation affects workflows that rely on symbol extraction for:

  • Mapping git diff changes to enclosing functions
  • Code navigation and analysis
  • Automated test generation based on function signatures

Environment:

Tool: extract_symbols from kit-mcp

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions