How can I get the node ID inside my implementation of hook_tokens()? I am trying to implement a custom token using the following code.

/**
 * Implements hook_token_info().
 */
function hook_token_info() {
  $type = array(
    'name' =&gt; `enter code here`t('xyz'),
    'description' =&gt; t('module.'),
    'needs-data' =&gt; 'xyz',
  );
  $tokens['full_html_form'] =array(
    'name' =&gt; t('Full HTML Form'),
    'description' =&gt; t('Returns full HTML Form based on the node'),
  );
  return array(
    'types' =&gt; array('abc' =&gt; $type),
    'tokens' =&gt; array('mno' =&gt; $tokens),
  );
}

/**
 * Implements hook_tokens().
 */
function hook_tokens($type, $tokens, array $data = array(), array $options = array()) {
  $replacements = array();

  if ($type == 'abc') {
    foreach ($tokens as $name =&gt; $original) {
      switch ($name) {
        case 'full_html_form':
        $output = core_module_get_node($node-&gt;nid); 
          $replacements[$original] = $output;
          break;
      }
    }
  }

  return $replacements;
}


I don't understand how to pass node ID to core_module_get_node(). How can I do it?
Since you are defining your own token type, you need to pass the node object to token_replace() in the $data array, for example as $data['node'] or $data['abc']-&gt;node, as you are telling Drupal the token requires the 'abc' data.

Your hook_token_info() implementation is wrong, anyway. The correct one would be the following one.

function mymodule_token_info() {
  $type = array(
    'name' =&gt; t('xyz'),
    'description' =&gt; t('The tokens for the xyz data.'),
    'needs-data' =&gt; 'xyz',
  );
  $tokens['full_html_form'] =array(
    'name' =&gt; t('Full HTML Form'),
    'description' =&gt; t('Returns full HTML Form based on the node'),
  );

  return array(
    'types' =&gt; array('abc' =&gt; $type),
    'tokens' =&gt; array('abc' =&gt; $tokens),  /* &lt;&lt; */
  );
}


From your code is not clear, but if the token is generated for a node, then you should implement code similar to the following one. (See token_token_info() as guideline.)

function mymodule_token_info() {
  $info['tokens']['node']['full_html_form'] = array(
    'name' =&gt; t('Full HTML Form'),
    'description' =&gt; t('Returns full HTML Form based on the node'),
  );

  return $info;
}


Modules can define new tokens for token types defined from other modules. The Token module is an example of such a module.