Skip to main content
Glama
sonisoft-cnanda

now-sdk-ext-mcp

Code Search

code_search

Search ServiceNow code artifacts like scripts and business rules by term, with filters for table, application scope, and search group. Returns matching records with line numbers.

Instructions

Search for code across a ServiceNow instance using the Code Search API. Finds matching scripts, business rules, script includes, and other code artifacts across the platform. Results include the record name, table, field, and matching line numbers with context.

Code Search works through Search Groups, which define sets of tables and fields to search. There is typically a default search group. Use list_code_search_groups to discover available groups, and list_code_search_tables to see which tables a group covers.

Key use cases:

  • Find scripts that reference a specific API, table, or pattern

  • Locate business rules, script includes, or UI scripts containing specific logic

  • Verify whether code has been deployed to an instance

  • Search within a specific application scope or table

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
instanceNoThe ServiceNow instance auth alias (e.g., "myinstance", "prod"). If not provided, falls back to the SN_AUTH_ALIAS environment variable.
termYesThe search term to find in code. Searches across script fields in the tables defined by the search group.
search_groupNoThe search group NAME to scope the search (e.g., "Default Code Search Group"). If omitted, the instance's default search group is used. Use `list_code_search_groups` to discover available groups.
tableNoSpecific table to search within (e.g., "sys_script_include"). Requires `search_group` to also be specified. Use `list_code_search_tables` to see available tables for a group.
current_appNoApplication scope to limit results to (e.g., "x_myapp"). When set, only results from this application scope are returned. Automatically sets search_all_scopes to false.
search_all_scopesNoWhen false, limits results to files within the scope specified by `current_app`. Defaults to true (search all scopes).
limitNoMaximum number of results to return.
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It explains the search group mechanism and dependencies but does not explicitly state that the tool is read-only or disclose any side effects, auth needs, or limits. The implication is it's a search, but more clarity would help.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured into three paragraphs: what the tool does, how it works (search groups), and key use cases. It is concise without being overly verbose; the bullet points for use cases are helpful but could be streamlined. Overall efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (7 parameters, 1 required) and no output schema, the description covers the essential concepts (search groups, default behavior, scoping). It could mention pagination or result structure but is largely sufficient for an agent to use the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, and the description adds meaningful context beyond the schema, such as explaining the relationship between search groups and tables, the interaction between current_app and search_all_scopes, and the default behavior. This helps an agent understand parameter usage better.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool searches for code across a ServiceNow instance, listing specific artifact types. It distinguishes from sibling tools like list_code_search_groups and list_code_search_tables by explaining they are for discovery, while code_search performs the actual search.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance on when to use the tool, including prerequisites (search groups), how to discover groups using sibling tools, and key use cases. It doesn't explicitly state when not to use, but the use cases imply it's for code search, not general table queries.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sonisoft-cnanda/now-sdk-ext-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server