Skip to main content
Glama

check_feature

Verify if a specific feature is currently loaded or available within the Emacs environment.

Instructions

Check whether a specific feature is loaded or available.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
featureYesFeature name to check.

Implementation Reference

  • The actual implementation of checkFeature function that evaluates Elisp to check if a feature is loaded using featurep. Takes a feature name string and returns the feature name if loaded or 'nil' if not.
    export async function checkFeature(feature: string): Promise<string> {
      const result = await emacsEval(
        `(format "%s" (if (featurep (intern-soft ${quoteString(feature)})) ${quoteString(feature)} "nil"))`
      );
      return stripQuotes(result);
    }
  • src/index.ts:23-23 (registration)
    Tool registration in the MCP server's ListToolsRequestSchema handler, defining the check_feature tool with its description and input schema.
    { name: "check_feature", description: "Check whether a specific feature is loaded or available.", inputSchema: { type: "object", properties: { feature: { type: "string", description: "Feature name to check." } }, required: ["feature"] } },
  • src/index.ts:58-59 (registration)
    The switch case handler that routes check_feature tool calls to the tools.checkFeature function, extracting the feature argument and returning the result as text.
    case "check_feature":
      return text(await tools.checkFeature(args.feature as string));
  • TypeScript type declaration for the checkFeature function, specifying it takes a feature string parameter and returns a Promise<string>.
    export declare function checkFeature(feature: string): Promise<string>;
  • The quoteString helper function used by checkFeature to safely escape strings for use in Elisp expressions.
    export function quoteString(s: string): string {
      const escaped = s
        .replace(/\\/g, "\\\\")
        .replace(/"/g, '\\"')
        .replace(/\n/g, "\\n");
      return `"${escaped}"`;

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/landermkerbey/ragmacs-mcp'

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