> For the complete documentation index, see [llms.txt](https://sitecoreuml.gitbook.io/sitecoredxg/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sitecoreuml.gitbook.io/sitecoredxg/how-to/creating-a-custom-trigger/executing-meta-data-json-generation.md).

# Executing Meta-Data JSON Generation

SitecoreDXG uses the same third-party libraries as StarUML - the UML IDE that SitecoreUML integrates with - for documentation generation. As part of the documentation generation process, SitecoreDXG first generates a new Meta-Data JSON file (.MDJ extension), which is effectively a project file for StarUML. However, sometimes you may want just the MDJ file and not the HTML documentation, especially considering that the MDJ file may only take a few seconds to generate for a very complex solution, whereas the HTML documentation may take several minutes. For this reason, SitecoreDXG includes the abiltiy to execute the MDJ file generation independently of the HTML documentation generation.

In order to generate just the Meta-Data JSON file, you need to call the `generateMetaDataJson` function of the `generation` module.

The function has the following syntax:

```
generation.generateMetaDataJson(
  Object data,        // the parsed JSON data response received from the serializer
  Fn successCallback, // callback to be executed on successful generation
  Fn errorCallback,   // callback to be executed on generation error
);
```

Following this syntax, the below can be used to execute the Meta-Data JSON file generation:

```javascript
generation.generateMetaDataJson(
  data,
  function function (mdjPath, targetFileName, targetFolderPath, targetFilePath) {
    ...your logic to run on success...
  },
  function (error) {
    ...your logic to run on error...
  }
);
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://sitecoreuml.gitbook.io/sitecoredxg/how-to/creating-a-custom-trigger/executing-meta-data-json-generation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
