Novelcrafter

Prompt Functions

Get an overview of all prompt function inside Novelcrafter and how to use them in your own custom prompts.

8 min read Last updated May 10, 2025

Acts

act

Extracts all possible ‘Acts’ from the given arguments. Defaults to the current Act, if no arguments are given.

act.fullText

Returns the full text of each ‘Act’ in the given arguments (or the current Act if none are provided).

act.name

Returns the name of each ‘Act’ in the given arguments (or the current Act if none are provided).

act.next

Returns the immediately following ‘Act’ for each possible ‘Act’ in the given arguments (or the current Act if none are provided).

act.number

Returns the number of each ‘Act’ in the given arguments (or the current Act if none are provided).

act.previous

Returns the immediately preceding ‘Act’ for each possible ‘Act’ in the given arguments (or the current Act if none are provided).

act.summary

Returns a summary of each ‘Act’ in the given arguments (or the current Act if none are provided).

act.title

Returns the title of each ‘Act’ in the given arguments (or the current Act if none are provided).

isAct

Filters the given collection of items to only those that are an actual ‘Act’

Lists

all

Creates a new list from the given arguments, whose matching mode is set to “all”.

any

Creates a new list from the given arguments, whose matching mode is set to “any”.

count

Returns the total number of elements in the given arguments.

join

Joins all given arguments into a single text value.

takeFirst

Returns the first N elements from the given arguments.

takeLast

Returns the last N elements from the given arguments.

without

Returns the haystack without the needle.

Logic

and

Filters the given arguments to all those that match to being true.

contains

Returns true if the given haystack contains the given needle (case-insensitive).

either

Returns the first argument that matches to not being empty.

endsWith

Returns true if the given haystack ends with the given needle (case-insensitive).

ifs

Returns the value for the first condition that is true, or the last value if none are true (e.g. “ifs(conditionA, valueA, conditionB, valueB, valueFallback)”).

isEmpty

Returns true if all given arguments matches to being empty.

isEqual

Returns true if all given arguments match to being equal to the first argument.

isGreaterOrEqual

Returns true if the first argument is greater than or equal to the second argument.

isGreaterThan

Returns true if the first argument is greater than the second argument.

isLessOrEqual

Returns true if the first argument is less than or equal to the second argument.

isLessThan

Returns true if the first argument is less than the second argument.

isNotEqual

Returns true if all given arguments match to not being equal to the first argument.

not

Returns true if any of the given arguments match to being false.

or

Filters the given arguments to any those that match to being true.

startsWith

Returns true if the given haystack starts with the given needle (case-insensitive).

Text

asList

Converts each given argument to a text container and renders them as a bulleted list.

asMarkdown

Renders each given argument as Markdown (nested elements will use increasing heading levels).

asNumberedList

Converts each given argument to a text container and renders them as a numbered list.

asPlainText

Renders each given argument as regular plain text.

asXml

Renders each given argument as (nested) XML.

content

Extracts the text content of the given arguments.

firstWords

Returns the first N number of words for the given text elements, excluding any titles or attributes.

lastWords

Returns the last N number of words for the given text elements, excluding any titles or attributes.

lowercase

Transforms a text into all lowercase letters.

pluralize

Returns a text with the count and the correct singular/plural form based on that count.

removePunctuation

Removes all punctuation from a text.

removeWhitespace

Removes all whitespace from a text.

title

Extracts the title of the given arguments.

uppercase

Transforms a text into all capital letters.

wordCount

Counts the number of total words in a given text.

wordsAfter

Returns the last N words of the text after the current message, up to the nearest boundary.

wordsBefore

Returns the last N words of the text before the current message, up to the nearest boundary.

Math

ceil

Rounds each given number up to the nearest full number.

divide

Divides the first number by the second number.

floor

Rounds each given number down to the nearest full number.

isNumber

Checks if each given argument can be a number.

multiply

Multiplies the first number by the second number.

round

Rounds each given number to the nearest full number.

Chapters

chapter

Extracts all possible ‘Chapters’ from the given arguments. Defaults to the current Chapter, if no arguments are given.

chapter.fullText

Returns the full text/prose for each possible ‘Chapter’ in the given arguments (or the current Chapter if none are provided).

chapter.name

Returns the custom name for each possible ‘Chapter’ in the given arguments (or the current Chapter if none are provided).

chapter.next

Returns the immediately following ‘Chapter’ for each possible ‘Chapter’ in the given arguments (or the current Chapter if none are provided).

chapter.number

Returns the number for each possible ‘Chapter’ in the given arguments (or the current Chapter if none are provided).

chapter.previous

Returns the immediately preceding ‘Chapter’ for each possible ‘Chapter’ in the given arguments (or the current Chapter if none are provided).

chapter.summary

Returns the summary for each possible ‘Chapter’ in the given arguments (or the current Chapter if none are provided).

chapter.title

Returns the full title for each possible ‘Chapter’ in the given arguments (or the current Chapter if none are provided).

isChapter

Filters the given collection of items to only those that are an actual ‘Chapter’

Codex

codex.aliases

Returns the aliases for each possible ‘Codex’ entry in the given arguments (or the current Codex context if none are provided).

codex.all

Returns all Codex entries, or extracts them from the given arguments.

codex.category

Returns the custom Codex category by name, or for each possible ‘Codex’ entry in the given arguments (or the current Codex context if none are provided).

codex.characters

Returns/Extracts all Codex entries that are of type ‘Character’.

codex.context

Returns the current codex context, or filters the given arguments by whether they are in the current codex context.

codex.description

Returns the description for each possible ‘Codex’ entry in the given arguments (or the current Codex context if none are provided).

codex.detail

Returns the given custom details for each possible ‘Codex’ entry in the given arguments (or the current Codex context if none are provided).

codex.get

Retrieves one or more Codex entries by their name or alias, or extracts them from the given arguments.

codex.global

Returns/Extracts all Codex entries that are marked as global (always included).

codex.has

Checks if the given arguments contain any (valid) Codex entries.

codex.hasDetail

Filters all Codex entries in given arguments (or the current Codex context if none are provided) by whether they have the given detail(s).

codex.hasTag

Filters all Codex entries in given arguments (or the current Codex context if none are provided) by whether they have the given tag(s).

codex.inCategory

Filters all Codex entries in given arguments (or the current Codex context if none are provided) by whether they are in the given custom category/categories.

codex.isCharacter

Filters all Codex entries in given arguments (or the current Codex context if none are provided) by whether they are of type ‘Character’.

codex.isLocation

Filters all Codex entries in given arguments (or the current Codex context if none are provided) by whether they are of type ‘Location’.

codex.isLore

Filters all Codex entries in given arguments (or the current Codex context if none are provided) by whether they are of type ‘Lore’.

codex.isObject

Filters all Codex entries in given arguments (or the current Codex context if none are provided) by whether they are of type ‘Object’.

codex.isOfType

Filters all Codex entries in given arguments (or the current Codex context if none are provided) by whether they are of the given type(s).

codex.isOther

Filters all Codex entries in given arguments (or the current Codex context if none are provided) by whether they are of type ‘Other’.

codex.isRelatedTo

Filters all Codex entries in given arguments (or the current Codex context if none are provided) by whether they are related to the given entry/entries (even across other Codex entries).

codex.isSubplot

Filters all Codex entries in given arguments (or the current Codex context if none are provided) by whether they are of type ‘Subplot’.

codex.locations

Returns/Extracts all Codex entries that are of type ‘Location’.

codex.lore

Returns/Extracts all Codex entries that are of type ‘Lore’.

codex.mentions

Retrieves all Codex entries that are mentioned in the given text/arguments.

codex.name

Returns the name for each possible ‘Codex’ entry in the given arguments (or the current Codex context if none are provided).

codex.notes

Returns the notes for each possible ‘Codex’ entry in the given arguments (or the current Codex context if none are provided).

codex.objects

Returns/Extracts all Codex entries that are of type ‘Object’.

codex.other

Returns/Extracts all Codex entries that are of type ‘Other’.

codex.relations

Returns all Codex entries that are related to the given arguments (or the current Codex context if none are provided).

codex.subplots

Returns/Extracts all Codex entries that are of type ‘Subplot’.

withRelations

Appends all Codex entries that are related to the given arguments (or the current Codex context if none are provided).

Other

date.today

Retrieves the current date in a human-readable format (e.g., “Monday, January 1, 2023”).

personas

Returns all available personas in the current context (based on the prompt type and the project(s) we’re in).

Context

hasMessage

Checks if there is any message content in the current scene beat/chat/text replacement selection.

hasTextAfter

Checks if there is any text content immediately following the current position in a document/scene.

hasTextBefore

Checks if there is any text content immediately preceding the current position in a document/scene.

isEndOfText

Checks if the current position is at the end of a document/scene (i.e., no text after).

isStartOfText

Checks if the current position is at the start of a document/scene (i.e., no text before).

message

Retrieves the message content of the current scene beat/chat/text replacement selection.

storySoFar

Returns the outline of the current Novel up to the current position (or the position determined by the given arguments).

storyToCome

Returns the outline of the current Novel from the current position (or the position determined by the given arguments) to the end.

textAfter

Retrieves the text content immediately following the current position in a document/scene.

textBefore

Retrieves the text content immediately preceding the current position in a document/scene.

textSoFar

Returns the text content of the current Novel up to the current position (or the position determined by the given arguments).

textToCome

Returns the text content of the current Novel from the current position (or the position determined by the given arguments) to the end.

Composition

include

Evaluates in the prompt component with the given name (case-insensitive).

input

Returns the value for the custom input with the given name (case-insensitive).

local

Stores or retrieves a value in the local memory of the current prompt (case-sensitive). If a value is provided, it will be stored; if no value is provided, the stored value will be returned.

Scenes

isScene

Filters a collection of items, returning only those that are actual Scene objects.

nextBeat

Retrieves the scene beat immediately following the current one (within the current scene).

previousBeat

Retrieves the scene beat immediately preceding the current one (within the current scene).

scene

Retrieves a list of Scene objects by all given arguments.

scene.fullText

Extracts the full text of a Scene for the given arguments.

scene.fullTitle

Extracts the full title of a Scene with chapter information for the given arguments.

scene.hasLabel

Filters a collection of items, returning only those that have a label with a given name.

scene.hasMention

Filters a collection of items, returning only those that have a mention to a given Codex entry.

scene.hasReference

Filters a collection of items, returning only those that have a reference to a given Codex entry.

scene.hasSubtitle

Filters a collection of items, returning only those that have a subtitle.

scene.hasSummary

Filters a collection of items, returning only those that have a summary.

scene.hasText

Filters a collection of items, returning only those that have text content.

scene.labels

Extracts the labels of a Scene for the given arguments.

scene.next

Gets the Scene that comes directly after a given Scene or the current one.

scene.nextSamePOV

Returns the next Scene that shares the same Point of View as the current/specified Scene.

scene.number

Extracts the number of a Scene for the given arguments.

scene.previous

Gets the Scene that comes directly before a given Scene or the current one.

scene.previousSamePOV

Returns the most recent preceding Scene that shares the same Point of View as the current/specified Scene.

scene.references

Extracts the references of a Scene for the given arguments.

scene.subtitle

Extracts the subtitle of a Scene for the given arguments.

scene.summary

Extracts the summary of a Scene for the given arguments.

scene.title

Extracts the title of a Scene for the given arguments.

Novels

novel

Returns the current Novel, if available.

novel.author

Returns the author of the current Novel.

novel.fullText

Returns the full text hierarchy of the current Novel, or the text for the given arguments (e.g. Acts, POVs, …).

novel.hasSeries

Checks if the current Novel is part of a series.

novel.language

Returns the language of the current Novel.

novel.outline

Returns the full outline hierarchy of the current Novel, or the outline for the given arguments (e.g. Acts, POVs, …).

novel.tense

Returns the tense of the current Novel.

novel.title

Returns the title of the current Novel.

Point Of View

pov

Extracts all available point of views from the given arguments (or the current scene if none are given).

pov.character

Extracts the character name from the given/current point of view(s).

pov.isFirstPerson

Returns all given (or current) point of views that are first person.

pov.isLimited

Returns all given (or current) point of views that are considered to be ‘limited’.

pov.isOmniscient

Returns all given (or current) point of views that are considered to be ‘omniscient’.

pov.isOverwrite

Returns all given (or current) point of views that are not the same as the Novel default point of view.

pov.isSecondPerson

Returns all given (or current) point of views that are second person.

pov.isThirdPerson

Returns all given (or current) point of views that are third person.

pov.type

Extracts the type of point of view from the given/current point of view(s).

Prompts

prompt.isNSFW

Checks if the current prompt is marked as NSFW (Not Safe For Work).

prompt.model

Retrieves the full model name of the current prompt (as provided by your AI connection).

Series

series

Retrieves the Series object to which the current novel belongs, if any.

series.description

Extract the description of the Series to which the current novel belongs, if any.

series.title

Extract the title of the Series to which the current novel belongs, if any.

Snippets

snippets.get

Retrieves a list of Snippets by all given arguments.

snippets.has

Check if there are Snippets with all given arguments.