Welcome to the forum!
While Inform’s natural language syntax can make for code that’s easy to read, it’s not always as easy to write, because you have to come up with the exact right natural-sounding thing that the compiler will actually accept, while an infinite number of other things both make sense as English and are close to what Inform needs but won’t work.
Below are different approaches to saying aloud the contents of something:
Lab is a room.
Box is an open container in the Lab. Matchbox is an open openable container in the box. Matchstick is in the matchbox.
when play begins:
say "list the contents of the box, including contents, as a sentence: [line break]";
list the contents of the box, including contents, as a sentence;
say line break;
say "say 'a list of things in the box including contents'[line break]";
say "[a list of things in the box including contents][line break]";
say "repeating through list of things enclosed by the box:[line break]";
repeat with item running through the list of things enclosed by the box begin;
say "[item].";
end repeat;
say "repeating through things enclosed by the box (no list):[line break]";
repeat with item running through things enclosed by the box begin;
say "[item].";
end repeat;
list the contents of the box, including contents, as a sentence
is a phrase. It must be used within a rule or another phrase. It can’t be used inside brackets in a say statement.
a list of <description of objects> including contents
is a say-phrase. It can only be used in a say statement. And it’s inflexible on the article: you can’t use “the” or omit the “a”.
list of <description of objects>
is a phrase returning a value – the list of objects you can then repeat through. But you don’t actually need to build a list, because repeat can take a description of objects directly as the last example shows. Save a list of...
for when you want to assign it to a variable for some other sort of processing.
So including contents
can only be used in those two particular cases, the list the contents phrase that Andrew mentioned, or that say phrase. Or you can say let LT be the list of things in the chest
and you’ll get just the things directly contained without getting their contents.
enclosed
will return all things contained and indirectly contained… but possibly other things, if you have things that are parts of things, or a person within the container who’s wearing or carrying things, or a supporter within the container that’s supporting things. If your game isn’t going to have any of those things, enclosed
is good enough, but if you’re doing something complicated, you’ll need something more complicated.