Skip to content

API Query Clan clan

SolWayward edited this page Dec 22, 2025 · 2 revisions

gm.query.clan

Endpoint: gm.query.clan

Syntax

gm.query.clan [search_terms...] [type_flags...] [sort:field[:order]]

Description

Search for clans using text search and type filters with AND logic (all criteria must match). Without specifying status keywords, defaults to showing only active clans.

Parameters

Parameter Type Required Description
search_terms string No Text to search in clan names, IDs, and kingdom names
type_flags flags No Filter by clan types (see Type Flags below)
sort:field[:order] string No Sort results by field (see Sorting Options below)

Type Flags

Status:

  • active - Active clans (default)
  • eliminated - Destroyed/eliminated clans
  • empty - Clans with no heroes

Faction Types:

  • bandit - Bandit clans
  • nonbandit - Non-bandit clans
  • noble - Noble houses
  • minor - Minor faction clans
  • rebel - Rebel clans
  • mercenary - Mercenary clans
  • mafia - Criminal organizations
  • outlaw - Outlaw clans
  • nomad - Nomadic clans
  • sect - Religious sects

Relationships:

  • withoutkingdom - Clans without a kingdom
  • player - Player's clan

Sorting Options

  • sort:id - Sort by StringId (default)
  • sort:name - Sort alphabetically by name
  • sort:tier - Sort by clan tier
  • sort:gold - Sort by gold amount
  • sort:renown - Sort by renown
  • sort:kingdom - Sort by kingdom name
  • sort:heroes - Sort by number of heroes
  • sort:[type_flag] - Sort by any type flag (e.g., sort:noble, sort:mercenary)

Add :desc for descending order or :asc for ascending (default):

  • sort:gold:desc - Sort richest first
  • sort:renown:desc - Sort highest renown first
  • sort:heroes:desc - Sort most heroes first

Examples

Find noble clans in Empire:

gm.query.clan empire noble

Find all bandit clans:

gm.query.clan bandit

Find eliminated clans:

gm.query.clan eliminated

Find mercenary clans:

gm.query.clan mercenary

Sort clans by gold (richest first):

gm.query.clan sort:gold:desc

Sort noble clans by renown:

gm.query.clan noble sort:renown:desc

Sort by mercenary type (mercenaries first):

gm.query.clan sort:mercenary

Find clans without kingdoms:

gm.query.clan withoutkingdom

Output

Success:

Found N clan(s) matching [criteria]:
[Name] ([StringId]) - Leader: [LeaderName], Kingdom: [KingdomName], Tier: [Tier], Renown: [Renown], Gold: [Gold], Heroes: [Count]

Notes

NOTE: Without specifying status keywords, the command defaults to showing only active clans. Use eliminated to search destroyed clans.

TIP: Use this command before clan management commands to find exact StringIds.

Related Commands

Last Updated: 2025-12-16

Quick Links

🏠 Home | Quick Reference | Syntax Guide


Hero Commands
Clan Commands
Kingdom Commands
Settlement Commands
Item Commands
Troop Commands
Caravan Commands
Bandit Commands
Query Commands

Clone this wiki locally