[GH-ISSUE #3985] [BUG]: Agent Plugin System Throws Cannot read properties of undefined (reading 'params') When Invoking Custom Skills #2533

Closed
opened 2026-02-22 18:30:06 -05:00 by yindo · 3 comments
Owner

Originally created by @vinridge on GitHub (Jun 11, 2025).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/3985

Originally assigned to: @shatfield4 on GitHub.

AnythingLLM-log.txt

How are you running AnythingLLM?

Docker (local)

What happened?

Describe the bug
When invoking a valid Custom Agent Skill in AnythingLLM v1.8.1, the agent system immediately fails with the error:

Cannot read properties of undefined (reading 'params')

This occurs even when the plugin is correctly formatted and verified to exist in the agent-skills folder, with proper plugin.json and a working handler.js.

Environment:

AnythingLLM version: 1.8.1

Dockerized install on Unraid

Skills verified present inside container at /app/server/storage/plugins/agent-skills/

Notes
This appears to be a regression — the agent system is not passing inputs to custom skills properly.

Are there known steps to reproduce?

To Reproduce
Steps to reproduce the behavior:

  1. Create a plugin in /app/server/storage/plugins/agent-skills/debug-skill
  2. Add a valid plugin.json:
{
  "name": "Debug Input",
  "hubId": "debug-skill",
  "description": "Debugging agent input flow",
  "inputs": [
    { "name": "language", "type": "string", "description": "Test input" }
  ],
  "active": true
}

# Add handler.js:

module.exports = async function handler(inputs, context) {
  return JSON.stringify(inputs, null, 2);
};

# Restart AnythingLLM container
# Use prompt:

# @agent debug input
# language: test

# Expected behavior:
# Agent skill should execute and return a debug JSON payload with the parsed inputs.

# Actual behavior:
# Agent crashes with:

# TypeError: Cannot read properties of undefined (reading 'params')
#    at Object.setup (/app/server/utils/agents/imported.js:195:48)


Originally created by @vinridge on GitHub (Jun 11, 2025). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/3985 Originally assigned to: @shatfield4 on GitHub. [AnythingLLM-log.txt](https://github.com/user-attachments/files/20697486/AnythingLLM-log.txt) ### How are you running AnythingLLM? Docker (local) ### What happened? **Describe the bug** When invoking a valid Custom Agent Skill in AnythingLLM v1.8.1, the agent system immediately fails with the error: Cannot read properties of undefined (reading 'params') This occurs even when the plugin is correctly formatted and verified to exist in the agent-skills folder, with proper `plugin.json` and a working `handler.js`. Environment: AnythingLLM version: 1.8.1 Dockerized install on Unraid Skills verified present inside container at /app/server/storage/plugins/agent-skills/ Notes This appears to be a regression — the agent system is not passing inputs to custom skills properly. ### Are there known steps to reproduce? **To Reproduce** Steps to reproduce the behavior: 1. Create a plugin in `/app/server/storage/plugins/agent-skills/debug-skill` 2. Add a valid `plugin.json`: ```json { "name": "Debug Input", "hubId": "debug-skill", "description": "Debugging agent input flow", "inputs": [ { "name": "language", "type": "string", "description": "Test input" } ], "active": true } # Add handler.js: module.exports = async function handler(inputs, context) { return JSON.stringify(inputs, null, 2); }; # Restart AnythingLLM container # Use prompt: # @agent debug input # language: test # Expected behavior: # Agent skill should execute and return a debug JSON payload with the parsed inputs. # Actual behavior: # Agent crashes with: # TypeError: Cannot read properties of undefined (reading 'params') # at Object.setup (/app/server/utils/agents/imported.js:195:48)
yindo added the possible buginvestigating labels 2026-02-22 18:30:06 -05:00
yindo closed this issue 2026-02-22 18:30:06 -05:00
Author
Owner

@shatfield4 commented on GitHub (Jun 11, 2025):

It looks like your plugin.json is not in the correct format. I created your agent skill in a way that just passes a single parameter and returns it as JSON where it looks like this.

plugin.json

{
    "hubId": "debug-skill",
    "active": true,
    "name": "Debug Input",
    "version": "1.0.0",
    "author": "test",
    "description": "Debugging agent input flow",
    "examples": [
      {
        "prompt": "Debug my input with language English",
        "call": "{\"language\": \"English\"}"
      }
    ],
    "setup_args": {},
    "entrypoint": {
      "file": "handler.js",
      "params": {
        "language": {
          "description": "Test input",
          "type": "string"
        }
      }
    }
}

handler.js

module.exports.runtime = {
  handler: async function ({ language }) {
    const callerId = `${this.config.name}-v${this.config.version}`;
    try {
      this.introspect(`${callerId} called with language: ${language}`);
      return JSON.stringify({ language });
    } catch (e) {
      this.introspect(`${callerId} failed to process input. Reason: ${e.message}`);
      this.logger(`${callerId} failed to process input`, e.message);
      return `Failed to process input. Error: ${e.message}`;
    }
  },
  validateParams: () => true // No params to validate
};

The issue that was throwing your error was that you were missing the params under the entrypoint field in the plugin.json.

Refer to https://docs.anythingllm.com/agent/custom/plugin-json for an example plugin.json and https://docs.anythingllm.com/agent/custom/handler-js for an example handler.js when creating your custom agent skills.

@shatfield4 commented on GitHub (Jun 11, 2025): It looks like your plugin.json is not in the correct format. I created your agent skill in a way that just passes a single parameter and returns it as JSON where it looks like this. **plugin.json** ```json { "hubId": "debug-skill", "active": true, "name": "Debug Input", "version": "1.0.0", "author": "test", "description": "Debugging agent input flow", "examples": [ { "prompt": "Debug my input with language English", "call": "{\"language\": \"English\"}" } ], "setup_args": {}, "entrypoint": { "file": "handler.js", "params": { "language": { "description": "Test input", "type": "string" } } } } ``` **handler.js** ```javascript module.exports.runtime = { handler: async function ({ language }) { const callerId = `${this.config.name}-v${this.config.version}`; try { this.introspect(`${callerId} called with language: ${language}`); return JSON.stringify({ language }); } catch (e) { this.introspect(`${callerId} failed to process input. Reason: ${e.message}`); this.logger(`${callerId} failed to process input`, e.message); return `Failed to process input. Error: ${e.message}`; } }, validateParams: () => true // No params to validate }; ``` The issue that was throwing your error was that you were missing the `params` under the entrypoint field in the `plugin.json`. Refer to https://docs.anythingllm.com/agent/custom/plugin-json for an example `plugin.json` and https://docs.anythingllm.com/agent/custom/handler-js for an example `handler.js` when creating your custom agent skills.
Author
Owner

@vinridge commented on GitHub (Jun 11, 2025):

@shatfield4 thank you for the correction. I apologize for the user error. I am somewhat new to LLM setup.

@vinridge commented on GitHub (Jun 11, 2025): @shatfield4 thank you for the correction. I apologize for the user error. I am somewhat new to LLM setup.
Author
Owner

@shatfield4 commented on GitHub (Jun 11, 2025):

No problem @vinridge!

@shatfield4 commented on GitHub (Jun 11, 2025): No problem @vinridge!
yindo changed title from [BUG]: Agent Plugin System Throws Cannot read properties of undefined (reading 'params') When Invoking Custom Skills to [GH-ISSUE #3985] [BUG]: Agent Plugin System Throws Cannot read properties of undefined (reading 'params') When Invoking Custom Skills 2026-06-05 14:47:07 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#2533