Categories

Keys List

List own enumerable keys using lodash _.keys

List own enumerable keys of an object.

Highlights:

  • Uses lodash _.keys
  • Own properties only
  • Returns a JSON array of keys

Example:

  • Object: {"a":1,"b":2}
  • Result: ["a","b"]

Enter a JSON object

Key Facts

Category
Data Processing
Input Types
textarea
Output Type
text
Sample Coverage
4
API Ready
Yes

Overview

The Keys List tool allows you to instantly extract and list all own enumerable property names from any JSON object using the reliable lodash _.keys method.

When to Use

  • When you need to verify the structure of a complex JSON object.
  • When you want to extract a list of field names for documentation or mapping purposes.
  • When you need to programmatically identify available keys in a data payload.

How It Works

  • Paste your JSON object into the input field.
  • The tool processes the input using the lodash _.keys function.
  • It filters out inherited properties to return only the object's own enumerable keys.
  • The output is returned as a clean, formatted JSON array of strings.

Use Cases

Quickly auditing API response schemas to identify available data fields.
Generating a list of column headers based on a sample JSON record.
Debugging data structures by verifying the presence of expected keys.

Examples

1. Extracting User Profile Fields

Frontend Developer
Background
I received a large user profile object from an API and needed to know exactly which fields were available to map them to my UI components.
Problem
The object was too large to scan manually, making it difficult to identify all available data points.
How to Use
Paste the user profile JSON into the input field and run the tool.
Example Config
{"id": 101, "username": "jdoe", "email": "[email protected]", "active": true}
Outcome
The tool returned: ["id", "username", "email", "active"].

2. Validating Configuration Keys

System Administrator
Background
I have a configuration file in JSON format and need to ensure all required keys are present before deploying.
Problem
Manually checking for missing keys in a nested configuration is prone to human error.
How to Use
Input the configuration object to get a flat list of all top-level keys.
Example Config
{"host": "localhost", "port": 8080, "debug": false, "retries": 3}
Outcome
The tool returned: ["host", "port", "debug", "retries"], allowing for a quick verification against the required schema.

Try with Samples

json

Related Hubs

FAQ

What does 'own enumerable keys' mean?

It means the tool only lists properties defined directly on the object itself, ignoring properties inherited through the prototype chain.

Can I process nested objects?

Yes, the tool will return the top-level keys of the provided JSON object.

Is the output format always a JSON array?

Yes, the result is consistently returned as a JSON array of strings representing the keys.

Does this tool modify my original data?

No, the tool only reads your input to extract the keys; your original data remains unchanged.

What happens if the input is not valid JSON?

The tool requires a valid JSON object to function correctly; invalid syntax will result in an error.

API Documentation

Request Endpoint

POST /en/api/tools/keys-list

Request Parameters

Parameter Name Type Required Description
objectInput textarea Yes Enter a JSON object

Response Format

{
  "result": "Processed text content",
  "error": "Error message (optional)",
  "message": "Notification message (optional)",
  "metadata": {
    "key": "value"
  }
}
Text: Text

AI MCP Documentation

Add this tool to your MCP server configuration:

{
  "mcpServers": {
    "elysiatools-keys-list": {
      "name": "keys-list",
      "description": "List own enumerable keys using lodash _.keys",
      "baseUrl": "https://elysiatools.com/mcp/sse?toolId=keys-list",
      "command": "",
      "args": [],
      "env": {},
      "isActive": true,
      "type": "sse"
    }
  }
}

You can chain multiple tools, e.g.: `https://elysiatools.com/mcp/sse?toolId=png-to-webp,jpg-to-webp,gif-to-webp`, max 20 tools.

If you encounter any issues, please contact us at [email protected]