> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/cortex-commands-guide/xql-library-commands.md).

# XQL Library Commands

* [getXQLLibraries](#getxqllibraries)
* [createXQLLibraries](#createxqllibraries)
* [deleteXQLLibraries](#deletexqllibraries)

#### getXQLLibraries

***

Gets a list of saved XQL library queries. XQL library queries are reusable named queries that can be referenced from other XQL queries.

<details>

<summary>Arguments</summary>

| Argument Name    | Description                                                                                                   | Required |
| ---------------- | ------------------------------------------------------------------------------------------------------------- | -------- |
| extra\_data      | Whether to include extra data in the response. possible values: true, false Possible values are: true, false. | Optional |
| xql\_query\_name | The name of the XQL query to retrieve.                                                                        | Optional |
| xql\_query\_tag  | The tag of the XQL query to retrieve.                                                                         | Optional |

</details>

<details>

<summary>Outputs</summary>

**Core.xqlLibraries.xql\_query\_name** *string*

The name of the XQL query.

**Core.xqlLibraries.xql\_query** *string*

The XQL query content.

**Core.xqlLibraries.xql\_query\_tags** *string*

The tags of the XQL query.

</details>

#### createXQLLibraries

***

Creates and saves an XQL library query, a reusable named query that can be referenced from other XQL queries.

<details>

<summary>Arguments</summary>

| Argument Name      | Description                                                                                          | Required |
| ------------------ | ---------------------------------------------------------------------------------------------------- | -------- |
| override\_existing | Whether to override existing queries. possible values: true, false Possible values are: true, false. | Optional |
| xql\_query         | The XQL query content.                                                                               | Required |
| xql\_query\_name   | The name of the XQL query.                                                                           | Required |
| xql\_query\_tag    | The tag of the XQL query.                                                                            | Optional |

</details>

**Outputs**

There are no outputs for this command.

#### deleteXQLLibraries

***

Deletes a saved XQL library query. Any other query still referencing the deleted library query will fail.

<details>

<summary>Arguments</summary>

| Argument Name    | Description                          | Required |
| ---------------- | ------------------------------------ | -------- |
| xql\_query\_name | The name of the XQL query to delete. | Optional |
| xql\_query\_tag  | The tag of the XQL query to delete.  | Optional |

</details>

**Outputs**

There are no outputs for this command.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://cortex-docs.paloaltonetworks.com/cortex-commands-guide/xql-library-commands.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
