Mira Library Create

Create a new library in Mira App Server

Mira Library Create

AI-generated

Overview

This node creates a new library in the Mira App Server. It allows users to define libraries either as local or remote, specifying details such as name, path, description, and optional settings like icon and plugin directory. This node is useful for automating the management of libraries within Mira, enabling integration workflows that programmatically add or update library configurations.

Practical examples include:

  • Automatically adding new local libraries when new projects are created.
  • Registering remote libraries hosted on different servers with specific URLs and ports.
  • Enabling hash calculation for files in a library to ensure integrity checks.

Properties

Name Meaning
Name The name of the library to create (required).
Path The file system path or identifier for the library (required).
Type The type of library: "Local" or "Remote".
Description A textual description of the library.
Icon An optional icon representing the library.
Enable Hash Boolean flag to enable hash calculation for files in the library.
Server URL The URL of the server hosting the remote library (only shown if Type is "Remote").
Server Port The port number of the remote server (default 8080, only shown if Type is "Remote").
Plugins Directory Optional directory path for plugins related to the library.

Output

The node outputs a JSON object containing:

  • created: A boolean indicating successful creation (true).
  • library: An object reflecting the created library's properties including name, path, type, description, icon, enableHash flag, and optionally serverURL, serverPort, and pluginsDir if applicable.
  • response: The raw response from the Mira API after the HTTP POST request.
  • timestamp: ISO string timestamp of when the operation was performed.
  • operation: The string "create" indicating the performed action.

No binary data output is produced by this node.

Dependencies

  • Requires an API key credential for authenticating requests to the Mira App Server.
  • The node makes an authenticated HTTP POST request to the /api/libraries endpoint of the Mira server.
  • If using remote libraries, the server URL and port must be correctly configured.
  • The node depends on helper functions for HTTP requests and error handling provided by the n8n environment.

Troubleshooting

  • Missing Required Fields: Errors will occur if the "Name" or "Path" properties are empty. Ensure these fields are filled before execution.
  • Authentication Failures: If the API key or authentication token is invalid or missing, the HTTP request will fail. Verify credentials are properly set up.
  • Invalid Server URL/Port: For remote libraries, incorrect server URL or port can cause connection errors. Confirm these values are correct and accessible.
  • API Endpoint Errors: If the Mira server returns an error (e.g., 400 or 500 status), check the request payload and server logs for more details.

Common error message example:

  • "Library name is required" — indicates the "Name" property was not provided.
  • "Library path is required" — indicates the "Path" property was not provided.

Resolving these involves providing valid inputs for the required fields.

Links and References

  • Mira App Server API documentation (for /api/libraries endpoint) — consult your Mira server API docs for detailed request/response formats.
  • n8n HTTP Request node documentation — for understanding how authenticated HTTP requests work in n8n.

Discussion